using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using C1.Win.C1Input;
using C1.Win.C1List;
using C1.Win.C1TrueDBGrid;
using PCSComMaterials.Inventory.BO;
using PCSComProcurement.Purchase.BO;
using PCSComProcurement.Purchase.DS;
using PCSComProduct.Items.BO;
using PCSComProduct.Items.DS;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
//using PCSComMaterials.Inventory.BO;
using PCSComUtils.MasterSetup.DS;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;

using PCSComUtils.Framework.ReportFrame.BO;
using PCSUtils.Framework.ReportFrame;

using AddNewModeEnum = C1.Win.C1TrueDBGrid.AddNewModeEnum;
using BeforeColEditEventArgs = C1.Win.C1TrueDBGrid.BeforeColEditEventArgs;
//using C1DataColumn = C1.Win.C1TrueDBGrid.C1DataColumn;
using C1DisplayColumn = C1.Win.C1TrueDBGrid.C1DisplayColumn;
using CancelEventArgs = System.ComponentModel.CancelEventArgs;
using ColEventArgs = C1.Win.C1TrueDBGrid.ColEventArgs;
using PCSComUtils.DataContext;
using PCSComUtils.MasterSetup.BO;

namespace PCSProcurement.Purchase
{
    /// <summary>
    /// Summary description for POPurchaseOrderReceipts.
    /// </summary>
    public class POPurchaseOrderReceipts : Form
    {
        #region Form controls

        private TextBox txtItem;
        private C1Combo cboCCN;
        private Label lblCCN;
        private TextBox txtPurchaseNo;
        private Button btnSearchPO;
        private Button btnSearchItem;
        private Label lblPostDate;
        private Label lblMasLoc;
        private TextBox txtReceiveNo;
        private Button btnSearchReceive;
        private RadioButton radByItem;
        private RadioButton radByPO;
        private TextBox txtMasLoc;
        private Button btnSearchMasLoc;
        private CheckBox chkRecFull;
        private C1TrueDBGrid dgrdData;
        private Button btnSave;
        private Button btnAdd;
        private Button btnHelp;
        private Button btnPrint;
        private Button btnClose;
        private C1DateEdit dtmPostDate;
        private System.Windows.Forms.TextBox txtLocation;
        private System.Windows.Forms.Button btnSearchLocation;
        private System.Windows.Forms.TextBox txtDescription;
        private System.Windows.Forms.Button btnSearchVendorByName;
        private System.Windows.Forms.Label lblDescription;
        private System.Windows.Forms.TextBox txtRevision;
        private System.Windows.Forms.Button btnSearchDescription;
        private System.Windows.Forms.Label lblLoc;
        private System.Windows.Forms.Label lblRevision;
        private System.Windows.Forms.Button btnSearchVendorByNo;
        private System.Windows.Forms.GroupBox grbOldInfo;
        private System.Windows.Forms.TextBox txtDeliverySlip;
        private System.Windows.Forms.RadioButton radBySlip;
        private System.Windows.Forms.Button btnDeliverySlip;
        private System.Windows.Forms.TextBox txtVendorNo;
        private System.Windows.Forms.TextBox txtVendorName;
        private System.Windows.Forms.Label lblVenderNo;
        private System.Windows.Forms.TextBox txtInvoice;
        private System.Windows.Forms.Button btnInvoice;
        private System.Windows.Forms.RadioButton radByInvoice;

        #endregion

        /// <summary>
        /// Required designer variable.
        /// </summary>
        private Container components = null;

        #region private constants
        private const string THIS = "PCSProcurement.Purchase.POPurchaseOrderReceipts";
        private const string RECEIPTLINE_COL = "ReceiptLine";
        private const string SEPERATOR = "-";
        private const string SLIP_END_FORMAT = "yyyyMMddhh";
        private const string YEAR_FILTER = "[Year]";
        private const string MONTH_FILTER = "[Month]";
        private const string DAY_FILTER = "[Day]";
        private const string HOUR_FILTER = "[Hour]";
        private const string MAKER_FLD = "Maker";
        #endregion

        #region variables
        private UtilsBO boUtils = new UtilsBO();
        private POPurchaseOrderReceiptsBO boPOReceipt = new POPurchaseOrderReceiptsBO();
        private POInvoiceBO boInvoice = new POInvoiceBO();
        private PO_PurchaseOrderMasterVO voPOMaster = new PO_PurchaseOrderMasterVO();
        private PO_PurchaseOrderReceiptMasterVO voPOReceiptMaster = new PO_PurchaseOrderReceiptMasterVO();
        private PO_PurchaseOrderDetailVO voPODetail = new PO_PurchaseOrderDetailVO();
        private PO_InvoiceMasterVO voInvoiceMaster = new PO_InvoiceMasterVO();
        ITM_Product voProduct = new ITM_Product();
        MST_MasterLocationVO voMasterLocation = new MST_MasterLocationVO();
        DateTime dtmCurrentDate = new DateTime();
        private DataSet dstData = null;
        private int intMasterLocationID = 0;
        private int intPartyID = 0;
        private int intCCNID = 0;
        private bool blnAddManual;
        private string strSelectedValue = string.Empty;
        private DateTime dtmSlipDate = DateTime.MaxValue;
        private DataSet dstCopy = new DataSet();
        private System.Windows.Forms.Label lblReceiveNo;
        DataTable dtbGridLayOut = new DataTable();
        private System.Windows.Forms.TextBox txtProductionLine;
        private System.Windows.Forms.TextBox txtOutside;
        private System.Windows.Forms.Button btnProductionLine;
        private System.Windows.Forms.Label lblProductionLine;
        private System.Windows.Forms.Button btnOutside;
        private System.Windows.Forms.RadioButton radOutside;
        private System.Windows.Forms.Button btnBOMShortage;

        private EnumAction mFormMode = EnumAction.Default;
        private System.Windows.Forms.ComboBox cboPurpose;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Button btnDelete;
        private System.Windows.Forms.Button btnDeleteRow;
        private string strPONumber = string.Empty;

        public EnumAction FormMode
        {
            get { return mFormMode; }
            set { mFormMode = value; }
        }

        #endregion

        public POPurchaseOrderReceipts()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }


        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(POPurchaseOrderReceipts));
            this.cboCCN = new C1.Win.C1List.C1Combo();
            this.lblCCN = new System.Windows.Forms.Label();
            this.txtPurchaseNo = new System.Windows.Forms.TextBox();
            this.btnSearchPO = new System.Windows.Forms.Button();
            this.txtItem = new System.Windows.Forms.TextBox();
            this.btnSearchItem = new System.Windows.Forms.Button();
            this.lblPostDate = new System.Windows.Forms.Label();
            this.chkRecFull = new System.Windows.Forms.CheckBox();
            this.lblMasLoc = new System.Windows.Forms.Label();
            this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
            this.txtReceiveNo = new System.Windows.Forms.TextBox();
            this.lblReceiveNo = new System.Windows.Forms.Label();
            this.btnSearchReceive = new System.Windows.Forms.Button();
            this.btnSave = new System.Windows.Forms.Button();
            this.btnAdd = new System.Windows.Forms.Button();
            this.btnHelp = new System.Windows.Forms.Button();
            this.btnPrint = new System.Windows.Forms.Button();
            this.btnClose = new System.Windows.Forms.Button();
            this.radByItem = new System.Windows.Forms.RadioButton();
            this.radByPO = new System.Windows.Forms.RadioButton();
            this.txtMasLoc = new System.Windows.Forms.TextBox();
            this.btnSearchMasLoc = new System.Windows.Forms.Button();
            this.dtmPostDate = new C1.Win.C1Input.C1DateEdit();
            this.txtLocation = new System.Windows.Forms.TextBox();
            this.btnSearchLocation = new System.Windows.Forms.Button();
            this.txtDescription = new System.Windows.Forms.TextBox();
            this.btnSearchVendorByName = new System.Windows.Forms.Button();
            this.lblDescription = new System.Windows.Forms.Label();
            this.txtRevision = new System.Windows.Forms.TextBox();
            this.btnSearchDescription = new System.Windows.Forms.Button();
            this.lblLoc = new System.Windows.Forms.Label();
            this.lblRevision = new System.Windows.Forms.Label();
            this.btnSearchVendorByNo = new System.Windows.Forms.Button();
            this.grbOldInfo = new System.Windows.Forms.GroupBox();
            this.radBySlip = new System.Windows.Forms.RadioButton();
            this.txtDeliverySlip = new System.Windows.Forms.TextBox();
            this.btnDeliverySlip = new System.Windows.Forms.Button();
            this.txtVendorNo = new System.Windows.Forms.TextBox();
            this.txtVendorName = new System.Windows.Forms.TextBox();
            this.lblVenderNo = new System.Windows.Forms.Label();
            this.txtInvoice = new System.Windows.Forms.TextBox();
            this.btnInvoice = new System.Windows.Forms.Button();
            this.radByInvoice = new System.Windows.Forms.RadioButton();
            this.txtProductionLine = new System.Windows.Forms.TextBox();
            this.txtOutside = new System.Windows.Forms.TextBox();
            this.btnProductionLine = new System.Windows.Forms.Button();
            this.lblProductionLine = new System.Windows.Forms.Label();
            this.btnOutside = new System.Windows.Forms.Button();
            this.radOutside = new System.Windows.Forms.RadioButton();
            this.btnBOMShortage = new System.Windows.Forms.Button();
            this.cboPurpose = new System.Windows.Forms.ComboBox();
            this.label1 = new System.Windows.Forms.Label();
            this.btnDelete = new System.Windows.Forms.Button();
            this.btnDeleteRow = new System.Windows.Forms.Button();
            ((System.ComponentModel.ISupportInitialize)(this.cboCCN)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmPostDate)).BeginInit();
            this.grbOldInfo.SuspendLayout();
            this.SuspendLayout();
            // 
            // cboCCN
            // 
            this.cboCCN.AccessibleDescription = resources.GetString("cboCCN.AccessibleDescription");
            this.cboCCN.AccessibleName = resources.GetString("cboCCN.AccessibleName");
            this.cboCCN.AddItemSeparator = ';';
            this.cboCCN.AllowRowSizing = C1.Win.C1List.RowSizingEnum.AllRows;
            this.cboCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboCCN.Anchor")));
            this.cboCCN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboCCN.BackgroundImage")));
            this.cboCCN.Caption = "";
            this.cboCCN.CaptionHeight = 17;
            this.cboCCN.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
            this.cboCCN.ColumnCaptionHeight = 17;
            this.cboCCN.ColumnFooterHeight = 17;
            this.cboCCN.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
            this.cboCCN.ContentHeight = 15;
            this.cboCCN.DeadAreaBackColor = System.Drawing.Color.Empty;
            this.cboCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboCCN.Dock")));
            this.cboCCN.EditorBackColor = System.Drawing.SystemColors.Window;
            this.cboCCN.EditorFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.cboCCN.EditorForeColor = System.Drawing.SystemColors.WindowText;
            this.cboCCN.EditorHeight = 15;
            this.cboCCN.Enabled = ((bool)(resources.GetObject("cboCCN.Enabled")));
            this.cboCCN.FlatStyle = C1.Win.C1List.FlatModeEnum.System;
            this.cboCCN.Font = ((System.Drawing.Font)(resources.GetObject("cboCCN.Font")));
            this.cboCCN.GapHeight = 2;
            this.cboCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboCCN.ImeMode")));
            this.cboCCN.ItemHeight = 15;
            this.cboCCN.Location = ((System.Drawing.Point)(resources.GetObject("cboCCN.Location")));
            this.cboCCN.MatchEntryTimeout = ((long)(2000));
            this.cboCCN.MaxDropDownItems = ((short)(5));
            this.cboCCN.MaxLength = 32767;
            this.cboCCN.MouseCursor = System.Windows.Forms.Cursors.Default;
            this.cboCCN.Name = "cboCCN";
            this.cboCCN.PartialRightColumn = false;
            this.cboCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboCCN.RightToLeft")));
            this.cboCCN.RowDivider.Color = System.Drawing.Color.DarkGray;
            this.cboCCN.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None;
            this.cboCCN.RowSubDividerColor = System.Drawing.Color.DarkGray;
            this.cboCCN.Size = ((System.Drawing.Size)(resources.GetObject("cboCCN.Size")));
            this.cboCCN.TabIndex = ((int)(resources.GetObject("cboCCN.TabIndex")));
            this.cboCCN.Text = resources.GetString("cboCCN.Text");
            this.cboCCN.Visible = ((bool)(resources.GetObject("cboCCN.Visible")));
            this.cboCCN.PropBag = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1List.Design.ContextWrapper\"><Da" +
                "ta>Group{BackColor:ControlDark;Border:None,,0, 0, 0, 0;AlignVert:Center;}Style2{" +
                "}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{ForeColor:High" +
                "lightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:InactiveCaptionText;Ba" +
                "ckColor:InactiveCaption;}Footer{}Caption{AlignHorz:Center;}Normal{BackColor:Wind" +
                "ow;}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style9{AlignHorz:N" +
                "ear;}OddRow{}RecordSelector{AlignImage:Center;}Heading{Wrap:True;AlignVert:Cente" +
                "r;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;BackColor:Control;}Style8{}Sty" +
                "le10{}Style11{}Style1{}</Data></Styles><Splits><C1.Win.C1List.ListBoxView AllowC" +
                "olSelect=\"False\" Name=\"\" CaptionHeight=\"17\" ColumnCaptionHeight=\"17\" ColumnFoote" +
                "rHeight=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup=\"1\"><ClientRect>0, 0," +
                " 118, 158</ClientRect><VScrollBar><Width>16</Width></VScrollBar><HScrollBar><Hei" +
                "ght>16</Height></HScrollBar><CaptionStyle parent=\"Style2\" me=\"Style9\" /><EvenRow" +
                "Style parent=\"EvenRow\" me=\"Style7\" /><FooterStyle parent=\"Footer\" me=\"Style3\" />" +
                "<GroupStyle parent=\"Group\" me=\"Style11\" /><HeadingStyle parent=\"Heading\" me=\"Sty" +
                "le2\" /><HighLightRowStyle parent=\"HighlightRow\" me=\"Style6\" /><InactiveStyle par" +
                "ent=\"Inactive\" me=\"Style4\" /><OddRowStyle parent=\"OddRow\" me=\"Style8\" /><RecordS" +
                "electorStyle parent=\"RecordSelector\" me=\"Style10\" /><SelectedStyle parent=\"Selec" +
                "ted\" me=\"Style5\" /><Style parent=\"Normal\" me=\"Style1\" /></C1.Win.C1List.ListBoxV" +
                "iew></Splits><NamedStyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" " +
                "me=\"Heading\" /><Style parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=" +
                "\"Caption\" /><Style parent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"S" +
                "elected\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style parent=\"Normal\" me=" +
                "\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=\"Heading\" me=\"Rec" +
                "ordSelector\" /><Style parent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1<" +
                "/vertSplits><horzSplits>1</horzSplits><Layout>Modified</Layout><DefaultRecSelWid" +
                "th>17</DefaultRecSelWidth></Blob>";
            // 
            // lblCCN
            // 
            this.lblCCN.AccessibleDescription = resources.GetString("lblCCN.AccessibleDescription");
            this.lblCCN.AccessibleName = resources.GetString("lblCCN.AccessibleName");
            this.lblCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCCN.Anchor")));
            this.lblCCN.AutoSize = ((bool)(resources.GetObject("lblCCN.AutoSize")));
            this.lblCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCCN.Dock")));
            this.lblCCN.Enabled = ((bool)(resources.GetObject("lblCCN.Enabled")));
            this.lblCCN.Font = ((System.Drawing.Font)(resources.GetObject("lblCCN.Font")));
            this.lblCCN.ForeColor = System.Drawing.Color.Maroon;
            this.lblCCN.Image = ((System.Drawing.Image)(resources.GetObject("lblCCN.Image")));
            this.lblCCN.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.ImageAlign")));
            this.lblCCN.ImageIndex = ((int)(resources.GetObject("lblCCN.ImageIndex")));
            this.lblCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCCN.ImeMode")));
            this.lblCCN.Location = ((System.Drawing.Point)(resources.GetObject("lblCCN.Location")));
            this.lblCCN.Name = "lblCCN";
            this.lblCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCCN.RightToLeft")));
            this.lblCCN.Size = ((System.Drawing.Size)(resources.GetObject("lblCCN.Size")));
            this.lblCCN.TabIndex = ((int)(resources.GetObject("lblCCN.TabIndex")));
            this.lblCCN.Text = resources.GetString("lblCCN.Text");
            this.lblCCN.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCCN.TextAlign")));
            this.lblCCN.Visible = ((bool)(resources.GetObject("lblCCN.Visible")));
            // 
            // txtPurchaseNo
            // 
            this.txtPurchaseNo.AccessibleDescription = resources.GetString("txtPurchaseNo.AccessibleDescription");
            this.txtPurchaseNo.AccessibleName = resources.GetString("txtPurchaseNo.AccessibleName");
            this.txtPurchaseNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPurchaseNo.Anchor")));
            this.txtPurchaseNo.AutoSize = ((bool)(resources.GetObject("txtPurchaseNo.AutoSize")));
            this.txtPurchaseNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPurchaseNo.BackgroundImage")));
            this.txtPurchaseNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPurchaseNo.Dock")));
            this.txtPurchaseNo.Enabled = ((bool)(resources.GetObject("txtPurchaseNo.Enabled")));
            this.txtPurchaseNo.Font = ((System.Drawing.Font)(resources.GetObject("txtPurchaseNo.Font")));
            this.txtPurchaseNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPurchaseNo.ImeMode")));
            this.txtPurchaseNo.Location = ((System.Drawing.Point)(resources.GetObject("txtPurchaseNo.Location")));
            this.txtPurchaseNo.MaxLength = ((int)(resources.GetObject("txtPurchaseNo.MaxLength")));
            this.txtPurchaseNo.Multiline = ((bool)(resources.GetObject("txtPurchaseNo.Multiline")));
            this.txtPurchaseNo.Name = "txtPurchaseNo";
            this.txtPurchaseNo.PasswordChar = ((char)(resources.GetObject("txtPurchaseNo.PasswordChar")));
            this.txtPurchaseNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPurchaseNo.RightToLeft")));
            this.txtPurchaseNo.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPurchaseNo.ScrollBars")));
            this.txtPurchaseNo.Size = ((System.Drawing.Size)(resources.GetObject("txtPurchaseNo.Size")));
            this.txtPurchaseNo.TabIndex = ((int)(resources.GetObject("txtPurchaseNo.TabIndex")));
            this.txtPurchaseNo.Text = resources.GetString("txtPurchaseNo.Text");
            this.txtPurchaseNo.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPurchaseNo.TextAlign")));
            this.txtPurchaseNo.Visible = ((bool)(resources.GetObject("txtPurchaseNo.Visible")));
            this.txtPurchaseNo.WordWrap = ((bool)(resources.GetObject("txtPurchaseNo.WordWrap")));
            // 
            // btnSearchPO
            // 
            this.btnSearchPO.AccessibleDescription = resources.GetString("btnSearchPO.AccessibleDescription");
            this.btnSearchPO.AccessibleName = resources.GetString("btnSearchPO.AccessibleName");
            this.btnSearchPO.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchPO.Anchor")));
            this.btnSearchPO.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchPO.BackgroundImage")));
            this.btnSearchPO.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchPO.Dock")));
            this.btnSearchPO.Enabled = ((bool)(resources.GetObject("btnSearchPO.Enabled")));
            this.btnSearchPO.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchPO.FlatStyle")));
            this.btnSearchPO.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchPO.Font")));
            this.btnSearchPO.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchPO.Image")));
            this.btnSearchPO.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchPO.ImageAlign")));
            this.btnSearchPO.ImageIndex = ((int)(resources.GetObject("btnSearchPO.ImageIndex")));
            this.btnSearchPO.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchPO.ImeMode")));
            this.btnSearchPO.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchPO.Location")));
            this.btnSearchPO.Name = "btnSearchPO";
            this.btnSearchPO.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchPO.RightToLeft")));
            this.btnSearchPO.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchPO.Size")));
            this.btnSearchPO.TabIndex = ((int)(resources.GetObject("btnSearchPO.TabIndex")));
            this.btnSearchPO.Text = resources.GetString("btnSearchPO.Text");
            this.btnSearchPO.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchPO.TextAlign")));
            this.btnSearchPO.Visible = ((bool)(resources.GetObject("btnSearchPO.Visible")));
            this.btnSearchPO.Click += new System.EventHandler(this.btnSearchPO_Click);
            // 
            // txtItem
            // 
            this.txtItem.AccessibleDescription = resources.GetString("txtItem.AccessibleDescription");
            this.txtItem.AccessibleName = resources.GetString("txtItem.AccessibleName");
            this.txtItem.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtItem.Anchor")));
            this.txtItem.AutoSize = ((bool)(resources.GetObject("txtItem.AutoSize")));
            this.txtItem.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtItem.BackgroundImage")));
            this.txtItem.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtItem.Dock")));
            this.txtItem.Enabled = ((bool)(resources.GetObject("txtItem.Enabled")));
            this.txtItem.Font = ((System.Drawing.Font)(resources.GetObject("txtItem.Font")));
            this.txtItem.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtItem.ImeMode")));
            this.txtItem.Location = ((System.Drawing.Point)(resources.GetObject("txtItem.Location")));
            this.txtItem.MaxLength = ((int)(resources.GetObject("txtItem.MaxLength")));
            this.txtItem.Multiline = ((bool)(resources.GetObject("txtItem.Multiline")));
            this.txtItem.Name = "txtItem";
            this.txtItem.PasswordChar = ((char)(resources.GetObject("txtItem.PasswordChar")));
            this.txtItem.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtItem.RightToLeft")));
            this.txtItem.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtItem.ScrollBars")));
            this.txtItem.Size = ((System.Drawing.Size)(resources.GetObject("txtItem.Size")));
            this.txtItem.TabIndex = ((int)(resources.GetObject("txtItem.TabIndex")));
            this.txtItem.Text = resources.GetString("txtItem.Text");
            this.txtItem.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtItem.TextAlign")));
            this.txtItem.Visible = ((bool)(resources.GetObject("txtItem.Visible")));
            this.txtItem.WordWrap = ((bool)(resources.GetObject("txtItem.WordWrap")));
            // 
            // btnSearchItem
            // 
            this.btnSearchItem.AccessibleDescription = resources.GetString("btnSearchItem.AccessibleDescription");
            this.btnSearchItem.AccessibleName = resources.GetString("btnSearchItem.AccessibleName");
            this.btnSearchItem.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchItem.Anchor")));
            this.btnSearchItem.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchItem.BackgroundImage")));
            this.btnSearchItem.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchItem.Dock")));
            this.btnSearchItem.Enabled = ((bool)(resources.GetObject("btnSearchItem.Enabled")));
            this.btnSearchItem.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchItem.FlatStyle")));
            this.btnSearchItem.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchItem.Font")));
            this.btnSearchItem.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchItem.Image")));
            this.btnSearchItem.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchItem.ImageAlign")));
            this.btnSearchItem.ImageIndex = ((int)(resources.GetObject("btnSearchItem.ImageIndex")));
            this.btnSearchItem.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchItem.ImeMode")));
            this.btnSearchItem.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchItem.Location")));
            this.btnSearchItem.Name = "btnSearchItem";
            this.btnSearchItem.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchItem.RightToLeft")));
            this.btnSearchItem.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchItem.Size")));
            this.btnSearchItem.TabIndex = ((int)(resources.GetObject("btnSearchItem.TabIndex")));
            this.btnSearchItem.Text = resources.GetString("btnSearchItem.Text");
            this.btnSearchItem.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchItem.TextAlign")));
            this.btnSearchItem.Visible = ((bool)(resources.GetObject("btnSearchItem.Visible")));
            this.btnSearchItem.Click += new System.EventHandler(this.btnSearchItem_Click);
            // 
            // lblPostDate
            // 
            this.lblPostDate.AccessibleDescription = resources.GetString("lblPostDate.AccessibleDescription");
            this.lblPostDate.AccessibleName = resources.GetString("lblPostDate.AccessibleName");
            this.lblPostDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPostDate.Anchor")));
            this.lblPostDate.AutoSize = ((bool)(resources.GetObject("lblPostDate.AutoSize")));
            this.lblPostDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPostDate.Dock")));
            this.lblPostDate.Enabled = ((bool)(resources.GetObject("lblPostDate.Enabled")));
            this.lblPostDate.Font = ((System.Drawing.Font)(resources.GetObject("lblPostDate.Font")));
            this.lblPostDate.ForeColor = System.Drawing.Color.Maroon;
            this.lblPostDate.Image = ((System.Drawing.Image)(resources.GetObject("lblPostDate.Image")));
            this.lblPostDate.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPostDate.ImageAlign")));
            this.lblPostDate.ImageIndex = ((int)(resources.GetObject("lblPostDate.ImageIndex")));
            this.lblPostDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPostDate.ImeMode")));
            this.lblPostDate.Location = ((System.Drawing.Point)(resources.GetObject("lblPostDate.Location")));
            this.lblPostDate.Name = "lblPostDate";
            this.lblPostDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPostDate.RightToLeft")));
            this.lblPostDate.Size = ((System.Drawing.Size)(resources.GetObject("lblPostDate.Size")));
            this.lblPostDate.TabIndex = ((int)(resources.GetObject("lblPostDate.TabIndex")));
            this.lblPostDate.Text = resources.GetString("lblPostDate.Text");
            this.lblPostDate.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPostDate.TextAlign")));
            this.lblPostDate.Visible = ((bool)(resources.GetObject("lblPostDate.Visible")));
            // 
            // chkRecFull
            // 
            this.chkRecFull.AccessibleDescription = resources.GetString("chkRecFull.AccessibleDescription");
            this.chkRecFull.AccessibleName = resources.GetString("chkRecFull.AccessibleName");
            this.chkRecFull.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("chkRecFull.Anchor")));
            this.chkRecFull.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("chkRecFull.Appearance")));
            this.chkRecFull.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("chkRecFull.BackgroundImage")));
            this.chkRecFull.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkRecFull.CheckAlign")));
            this.chkRecFull.Checked = true;
            this.chkRecFull.CheckState = System.Windows.Forms.CheckState.Checked;
            this.chkRecFull.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("chkRecFull.Dock")));
            this.chkRecFull.Enabled = ((bool)(resources.GetObject("chkRecFull.Enabled")));
            this.chkRecFull.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("chkRecFull.FlatStyle")));
            this.chkRecFull.Font = ((System.Drawing.Font)(resources.GetObject("chkRecFull.Font")));
            this.chkRecFull.Image = ((System.Drawing.Image)(resources.GetObject("chkRecFull.Image")));
            this.chkRecFull.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkRecFull.ImageAlign")));
            this.chkRecFull.ImageIndex = ((int)(resources.GetObject("chkRecFull.ImageIndex")));
            this.chkRecFull.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("chkRecFull.ImeMode")));
            this.chkRecFull.Location = ((System.Drawing.Point)(resources.GetObject("chkRecFull.Location")));
            this.chkRecFull.Name = "chkRecFull";
            this.chkRecFull.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("chkRecFull.RightToLeft")));
            this.chkRecFull.Size = ((System.Drawing.Size)(resources.GetObject("chkRecFull.Size")));
            this.chkRecFull.TabIndex = ((int)(resources.GetObject("chkRecFull.TabIndex")));
            this.chkRecFull.Text = resources.GetString("chkRecFull.Text");
            this.chkRecFull.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("chkRecFull.TextAlign")));
            this.chkRecFull.Visible = ((bool)(resources.GetObject("chkRecFull.Visible")));
            this.chkRecFull.CheckedChanged += new System.EventHandler(this.chkRecFull_CheckedChanged);
            // 
            // lblMasLoc
            // 
            this.lblMasLoc.AccessibleDescription = resources.GetString("lblMasLoc.AccessibleDescription");
            this.lblMasLoc.AccessibleName = resources.GetString("lblMasLoc.AccessibleName");
            this.lblMasLoc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblMasLoc.Anchor")));
            this.lblMasLoc.AutoSize = ((bool)(resources.GetObject("lblMasLoc.AutoSize")));
            this.lblMasLoc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblMasLoc.Dock")));
            this.lblMasLoc.Enabled = ((bool)(resources.GetObject("lblMasLoc.Enabled")));
            this.lblMasLoc.Font = ((System.Drawing.Font)(resources.GetObject("lblMasLoc.Font")));
            this.lblMasLoc.ForeColor = System.Drawing.Color.Maroon;
            this.lblMasLoc.Image = ((System.Drawing.Image)(resources.GetObject("lblMasLoc.Image")));
            this.lblMasLoc.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblMasLoc.ImageAlign")));
            this.lblMasLoc.ImageIndex = ((int)(resources.GetObject("lblMasLoc.ImageIndex")));
            this.lblMasLoc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblMasLoc.ImeMode")));
            this.lblMasLoc.Location = ((System.Drawing.Point)(resources.GetObject("lblMasLoc.Location")));
            this.lblMasLoc.Name = "lblMasLoc";
            this.lblMasLoc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblMasLoc.RightToLeft")));
            this.lblMasLoc.Size = ((System.Drawing.Size)(resources.GetObject("lblMasLoc.Size")));
            this.lblMasLoc.TabIndex = ((int)(resources.GetObject("lblMasLoc.TabIndex")));
            this.lblMasLoc.Text = resources.GetString("lblMasLoc.Text");
            this.lblMasLoc.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblMasLoc.TextAlign")));
            this.lblMasLoc.Visible = ((bool)(resources.GetObject("lblMasLoc.Visible")));
            // 
            // dgrdData
            // 
            this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
            this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
            this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
            this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
            this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
            this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
            this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
            this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
            this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
            this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
            this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
            this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
            this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
            this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
            this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
            this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
            this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
            this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
            this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
            this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
            this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
            this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
            this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
            this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
            this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
            this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
            this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
            this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
            this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
            this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
            this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
            this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
            this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
            this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
            this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
            this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
            this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
            this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
            this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
            this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
            this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
            this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
            this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
            this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
            this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
            this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
            this.dgrdData.Name = "dgrdData";
            this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
            this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
            this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
            this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
            this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
            this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
            this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
            this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
            this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
            this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
            this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
            this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
            this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
            this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
            this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
            this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
            this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
            this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
            this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
            this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
            this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
            this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
            this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
            this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
            this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
            this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
            this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
            this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
            this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
            this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
            this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
            this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
            this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
            this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
            this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
            this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
            this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
            this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
            this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
            this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
            this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
            this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
            this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
            this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
            this.dgrdData.Text = resources.GetString("dgrdData.Text");
            this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
            this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
            this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
            this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
            this.dgrdData.AfterDelete += new System.EventHandler(this.dgrdData_AfterDelete);
            this.dgrdData.RowColChange += new C1.Win.C1TrueDBGrid.RowColChangeEventHandler(this.dgrdData_RowColChange);
            this.dgrdData.BeforeColEdit += new C1.Win.C1TrueDBGrid.BeforeColEditEventHandler(this.dgrdData_BeforeColEdit);
            this.dgrdData.ButtonClick += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_ButtonClick);
            this.dgrdData.AfterColUpdate += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColUpdate);
            this.dgrdData.BeforeColUpdate += new C1.Win.C1TrueDBGrid.BeforeColUpdateEventHandler(this.dgrdData_BeforeColUpdate);
            this.dgrdData.BeforeDelete += new C1.Win.C1TrueDBGrid.CancelEventHandler(this.dgrdData_BeforeDelete);
            this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown_1);
            this.dgrdData.OnAddNew += new System.EventHandler(this.dgrdData_OnAddNew);
            this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
            // 
            // txtReceiveNo
            // 
            this.txtReceiveNo.AccessibleDescription = resources.GetString("txtReceiveNo.AccessibleDescription");
            this.txtReceiveNo.AccessibleName = resources.GetString("txtReceiveNo.AccessibleName");
            this.txtReceiveNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtReceiveNo.Anchor")));
            this.txtReceiveNo.AutoSize = ((bool)(resources.GetObject("txtReceiveNo.AutoSize")));
            this.txtReceiveNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtReceiveNo.BackgroundImage")));
            this.txtReceiveNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtReceiveNo.Dock")));
            this.txtReceiveNo.Enabled = ((bool)(resources.GetObject("txtReceiveNo.Enabled")));
            this.txtReceiveNo.Font = ((System.Drawing.Font)(resources.GetObject("txtReceiveNo.Font")));
            this.txtReceiveNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtReceiveNo.ImeMode")));
            this.txtReceiveNo.Location = ((System.Drawing.Point)(resources.GetObject("txtReceiveNo.Location")));
            this.txtReceiveNo.MaxLength = ((int)(resources.GetObject("txtReceiveNo.MaxLength")));
            this.txtReceiveNo.Multiline = ((bool)(resources.GetObject("txtReceiveNo.Multiline")));
            this.txtReceiveNo.Name = "txtReceiveNo";
            this.txtReceiveNo.PasswordChar = ((char)(resources.GetObject("txtReceiveNo.PasswordChar")));
            this.txtReceiveNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtReceiveNo.RightToLeft")));
            this.txtReceiveNo.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtReceiveNo.ScrollBars")));
            this.txtReceiveNo.Size = ((System.Drawing.Size)(resources.GetObject("txtReceiveNo.Size")));
            this.txtReceiveNo.TabIndex = ((int)(resources.GetObject("txtReceiveNo.TabIndex")));
            this.txtReceiveNo.Text = resources.GetString("txtReceiveNo.Text");
            this.txtReceiveNo.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtReceiveNo.TextAlign")));
            this.txtReceiveNo.Visible = ((bool)(resources.GetObject("txtReceiveNo.Visible")));
            this.txtReceiveNo.WordWrap = ((bool)(resources.GetObject("txtReceiveNo.WordWrap")));
            // 
            // lblReceiveNo
            // 
            this.lblReceiveNo.AccessibleDescription = resources.GetString("lblReceiveNo.AccessibleDescription");
            this.lblReceiveNo.AccessibleName = resources.GetString("lblReceiveNo.AccessibleName");
            this.lblReceiveNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblReceiveNo.Anchor")));
            this.lblReceiveNo.AutoSize = ((bool)(resources.GetObject("lblReceiveNo.AutoSize")));
            this.lblReceiveNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblReceiveNo.Dock")));
            this.lblReceiveNo.Enabled = ((bool)(resources.GetObject("lblReceiveNo.Enabled")));
            this.lblReceiveNo.Font = ((System.Drawing.Font)(resources.GetObject("lblReceiveNo.Font")));
            this.lblReceiveNo.ForeColor = System.Drawing.Color.Maroon;
            this.lblReceiveNo.Image = ((System.Drawing.Image)(resources.GetObject("lblReceiveNo.Image")));
            this.lblReceiveNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblReceiveNo.ImageAlign")));
            this.lblReceiveNo.ImageIndex = ((int)(resources.GetObject("lblReceiveNo.ImageIndex")));
            this.lblReceiveNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblReceiveNo.ImeMode")));
            this.lblReceiveNo.Location = ((System.Drawing.Point)(resources.GetObject("lblReceiveNo.Location")));
            this.lblReceiveNo.Name = "lblReceiveNo";
            this.lblReceiveNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblReceiveNo.RightToLeft")));
            this.lblReceiveNo.Size = ((System.Drawing.Size)(resources.GetObject("lblReceiveNo.Size")));
            this.lblReceiveNo.TabIndex = ((int)(resources.GetObject("lblReceiveNo.TabIndex")));
            this.lblReceiveNo.Text = resources.GetString("lblReceiveNo.Text");
            this.lblReceiveNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblReceiveNo.TextAlign")));
            this.lblReceiveNo.Visible = ((bool)(resources.GetObject("lblReceiveNo.Visible")));
            // 
            // btnSearchReceive
            // 
            this.btnSearchReceive.AccessibleDescription = resources.GetString("btnSearchReceive.AccessibleDescription");
            this.btnSearchReceive.AccessibleName = resources.GetString("btnSearchReceive.AccessibleName");
            this.btnSearchReceive.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchReceive.Anchor")));
            this.btnSearchReceive.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchReceive.BackgroundImage")));
            this.btnSearchReceive.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchReceive.Dock")));
            this.btnSearchReceive.Enabled = ((bool)(resources.GetObject("btnSearchReceive.Enabled")));
            this.btnSearchReceive.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchReceive.FlatStyle")));
            this.btnSearchReceive.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchReceive.Font")));
            this.btnSearchReceive.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchReceive.Image")));
            this.btnSearchReceive.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchReceive.ImageAlign")));
            this.btnSearchReceive.ImageIndex = ((int)(resources.GetObject("btnSearchReceive.ImageIndex")));
            this.btnSearchReceive.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchReceive.ImeMode")));
            this.btnSearchReceive.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchReceive.Location")));
            this.btnSearchReceive.Name = "btnSearchReceive";
            this.btnSearchReceive.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchReceive.RightToLeft")));
            this.btnSearchReceive.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchReceive.Size")));
            this.btnSearchReceive.TabIndex = ((int)(resources.GetObject("btnSearchReceive.TabIndex")));
            this.btnSearchReceive.Text = resources.GetString("btnSearchReceive.Text");
            this.btnSearchReceive.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchReceive.TextAlign")));
            this.btnSearchReceive.Visible = ((bool)(resources.GetObject("btnSearchReceive.Visible")));
            this.btnSearchReceive.Click += new System.EventHandler(this.btnSearchReceive_Click);
            // 
            // btnSave
            // 
            this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
            this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
            this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
            this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
            this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
            this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
            this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
            this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
            this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
            this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
            this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
            this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
            this.btnSave.Name = "btnSave";
            this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
            this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
            this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
            this.btnSave.Text = resources.GetString("btnSave.Text");
            this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
            this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
            // 
            // btnAdd
            // 
            this.btnAdd.AccessibleDescription = resources.GetString("btnAdd.AccessibleDescription");
            this.btnAdd.AccessibleName = resources.GetString("btnAdd.AccessibleName");
            this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnAdd.Anchor")));
            this.btnAdd.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnAdd.BackgroundImage")));
            this.btnAdd.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnAdd.Dock")));
            this.btnAdd.Enabled = ((bool)(resources.GetObject("btnAdd.Enabled")));
            this.btnAdd.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnAdd.FlatStyle")));
            this.btnAdd.Font = ((System.Drawing.Font)(resources.GetObject("btnAdd.Font")));
            this.btnAdd.Image = ((System.Drawing.Image)(resources.GetObject("btnAdd.Image")));
            this.btnAdd.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.ImageAlign")));
            this.btnAdd.ImageIndex = ((int)(resources.GetObject("btnAdd.ImageIndex")));
            this.btnAdd.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnAdd.ImeMode")));
            this.btnAdd.Location = ((System.Drawing.Point)(resources.GetObject("btnAdd.Location")));
            this.btnAdd.Name = "btnAdd";
            this.btnAdd.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnAdd.RightToLeft")));
            this.btnAdd.Size = ((System.Drawing.Size)(resources.GetObject("btnAdd.Size")));
            this.btnAdd.TabIndex = ((int)(resources.GetObject("btnAdd.TabIndex")));
            this.btnAdd.Text = resources.GetString("btnAdd.Text");
            this.btnAdd.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnAdd.TextAlign")));
            this.btnAdd.Visible = ((bool)(resources.GetObject("btnAdd.Visible")));
            this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
            // 
            // btnHelp
            // 
            this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
            this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
            this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
            this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
            this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
            this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
            this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
            this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
            this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
            this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
            this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
            this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
            this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
            this.btnHelp.Name = "btnHelp";
            this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
            this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
            this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
            this.btnHelp.Text = resources.GetString("btnHelp.Text");
            this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
            this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
            this.btnHelp.Click += new System.EventHandler(this.btnHelp_Click);
            // 
            // btnPrint
            // 
            this.btnPrint.AccessibleDescription = resources.GetString("btnPrint.AccessibleDescription");
            this.btnPrint.AccessibleName = resources.GetString("btnPrint.AccessibleName");
            this.btnPrint.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnPrint.Anchor")));
            this.btnPrint.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnPrint.BackgroundImage")));
            this.btnPrint.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnPrint.Dock")));
            this.btnPrint.Enabled = ((bool)(resources.GetObject("btnPrint.Enabled")));
            this.btnPrint.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnPrint.FlatStyle")));
            this.btnPrint.Font = ((System.Drawing.Font)(resources.GetObject("btnPrint.Font")));
            this.btnPrint.Image = ((System.Drawing.Image)(resources.GetObject("btnPrint.Image")));
            this.btnPrint.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPrint.ImageAlign")));
            this.btnPrint.ImageIndex = ((int)(resources.GetObject("btnPrint.ImageIndex")));
            this.btnPrint.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnPrint.ImeMode")));
            this.btnPrint.Location = ((System.Drawing.Point)(resources.GetObject("btnPrint.Location")));
            this.btnPrint.Name = "btnPrint";
            this.btnPrint.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnPrint.RightToLeft")));
            this.btnPrint.Size = ((System.Drawing.Size)(resources.GetObject("btnPrint.Size")));
            this.btnPrint.TabIndex = ((int)(resources.GetObject("btnPrint.TabIndex")));
            this.btnPrint.Text = resources.GetString("btnPrint.Text");
            this.btnPrint.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnPrint.TextAlign")));
            this.btnPrint.Visible = ((bool)(resources.GetObject("btnPrint.Visible")));
            this.btnPrint.Click += new System.EventHandler(this.btnPrint_Click);
            // 
            // btnClose
            // 
            this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
            this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
            this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
            this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
            this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
            this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
            this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
            this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
            this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
            this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
            this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
            this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
            this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
            this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
            this.btnClose.Name = "btnClose";
            this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
            this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
            this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
            this.btnClose.Text = resources.GetString("btnClose.Text");
            this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
            this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
            this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
            // 
            // radByItem
            // 
            this.radByItem.AccessibleDescription = resources.GetString("radByItem.AccessibleDescription");
            this.radByItem.AccessibleName = resources.GetString("radByItem.AccessibleName");
            this.radByItem.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radByItem.Anchor")));
            this.radByItem.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radByItem.Appearance")));
            this.radByItem.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radByItem.BackgroundImage")));
            this.radByItem.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByItem.CheckAlign")));
            this.radByItem.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radByItem.Dock")));
            this.radByItem.Enabled = ((bool)(resources.GetObject("radByItem.Enabled")));
            this.radByItem.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radByItem.FlatStyle")));
            this.radByItem.Font = ((System.Drawing.Font)(resources.GetObject("radByItem.Font")));
            this.radByItem.Image = ((System.Drawing.Image)(resources.GetObject("radByItem.Image")));
            this.radByItem.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByItem.ImageAlign")));
            this.radByItem.ImageIndex = ((int)(resources.GetObject("radByItem.ImageIndex")));
            this.radByItem.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radByItem.ImeMode")));
            this.radByItem.Location = ((System.Drawing.Point)(resources.GetObject("radByItem.Location")));
            this.radByItem.Name = "radByItem";
            this.radByItem.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radByItem.RightToLeft")));
            this.radByItem.Size = ((System.Drawing.Size)(resources.GetObject("radByItem.Size")));
            this.radByItem.TabIndex = ((int)(resources.GetObject("radByItem.TabIndex")));
            this.radByItem.Text = resources.GetString("radByItem.Text");
            this.radByItem.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByItem.TextAlign")));
            this.radByItem.Visible = ((bool)(resources.GetObject("radByItem.Visible")));
            this.radByItem.CheckedChanged += new System.EventHandler(this.radByItem_CheckedChanged);
            // 
            // radByPO
            // 
            this.radByPO.AccessibleDescription = resources.GetString("radByPO.AccessibleDescription");
            this.radByPO.AccessibleName = resources.GetString("radByPO.AccessibleName");
            this.radByPO.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radByPO.Anchor")));
            this.radByPO.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radByPO.Appearance")));
            this.radByPO.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radByPO.BackgroundImage")));
            this.radByPO.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPO.CheckAlign")));
            this.radByPO.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radByPO.Dock")));
            this.radByPO.Enabled = ((bool)(resources.GetObject("radByPO.Enabled")));
            this.radByPO.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radByPO.FlatStyle")));
            this.radByPO.Font = ((System.Drawing.Font)(resources.GetObject("radByPO.Font")));
            this.radByPO.Image = ((System.Drawing.Image)(resources.GetObject("radByPO.Image")));
            this.radByPO.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPO.ImageAlign")));
            this.radByPO.ImageIndex = ((int)(resources.GetObject("radByPO.ImageIndex")));
            this.radByPO.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radByPO.ImeMode")));
            this.radByPO.Location = ((System.Drawing.Point)(resources.GetObject("radByPO.Location")));
            this.radByPO.Name = "radByPO";
            this.radByPO.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radByPO.RightToLeft")));
            this.radByPO.Size = ((System.Drawing.Size)(resources.GetObject("radByPO.Size")));
            this.radByPO.TabIndex = ((int)(resources.GetObject("radByPO.TabIndex")));
            this.radByPO.Text = resources.GetString("radByPO.Text");
            this.radByPO.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByPO.TextAlign")));
            this.radByPO.Visible = ((bool)(resources.GetObject("radByPO.Visible")));
            this.radByPO.CheckedChanged += new System.EventHandler(this.radByPO_CheckedChanged);
            // 
            // txtMasLoc
            // 
            this.txtMasLoc.AccessibleDescription = resources.GetString("txtMasLoc.AccessibleDescription");
            this.txtMasLoc.AccessibleName = resources.GetString("txtMasLoc.AccessibleName");
            this.txtMasLoc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtMasLoc.Anchor")));
            this.txtMasLoc.AutoSize = ((bool)(resources.GetObject("txtMasLoc.AutoSize")));
            this.txtMasLoc.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtMasLoc.BackgroundImage")));
            this.txtMasLoc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtMasLoc.Dock")));
            this.txtMasLoc.Enabled = ((bool)(resources.GetObject("txtMasLoc.Enabled")));
            this.txtMasLoc.Font = ((System.Drawing.Font)(resources.GetObject("txtMasLoc.Font")));
            this.txtMasLoc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtMasLoc.ImeMode")));
            this.txtMasLoc.Location = ((System.Drawing.Point)(resources.GetObject("txtMasLoc.Location")));
            this.txtMasLoc.MaxLength = ((int)(resources.GetObject("txtMasLoc.MaxLength")));
            this.txtMasLoc.Multiline = ((bool)(resources.GetObject("txtMasLoc.Multiline")));
            this.txtMasLoc.Name = "txtMasLoc";
            this.txtMasLoc.PasswordChar = ((char)(resources.GetObject("txtMasLoc.PasswordChar")));
            this.txtMasLoc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtMasLoc.RightToLeft")));
            this.txtMasLoc.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtMasLoc.ScrollBars")));
            this.txtMasLoc.Size = ((System.Drawing.Size)(resources.GetObject("txtMasLoc.Size")));
            this.txtMasLoc.TabIndex = ((int)(resources.GetObject("txtMasLoc.TabIndex")));
            this.txtMasLoc.Text = resources.GetString("txtMasLoc.Text");
            this.txtMasLoc.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtMasLoc.TextAlign")));
            this.txtMasLoc.Visible = ((bool)(resources.GetObject("txtMasLoc.Visible")));
            this.txtMasLoc.WordWrap = ((bool)(resources.GetObject("txtMasLoc.WordWrap")));
            // 
            // btnSearchMasLoc
            // 
            this.btnSearchMasLoc.AccessibleDescription = resources.GetString("btnSearchMasLoc.AccessibleDescription");
            this.btnSearchMasLoc.AccessibleName = resources.GetString("btnSearchMasLoc.AccessibleName");
            this.btnSearchMasLoc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchMasLoc.Anchor")));
            this.btnSearchMasLoc.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchMasLoc.BackgroundImage")));
            this.btnSearchMasLoc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchMasLoc.Dock")));
            this.btnSearchMasLoc.Enabled = ((bool)(resources.GetObject("btnSearchMasLoc.Enabled")));
            this.btnSearchMasLoc.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchMasLoc.FlatStyle")));
            this.btnSearchMasLoc.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchMasLoc.Font")));
            this.btnSearchMasLoc.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchMasLoc.Image")));
            this.btnSearchMasLoc.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchMasLoc.ImageAlign")));
            this.btnSearchMasLoc.ImageIndex = ((int)(resources.GetObject("btnSearchMasLoc.ImageIndex")));
            this.btnSearchMasLoc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchMasLoc.ImeMode")));
            this.btnSearchMasLoc.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchMasLoc.Location")));
            this.btnSearchMasLoc.Name = "btnSearchMasLoc";
            this.btnSearchMasLoc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchMasLoc.RightToLeft")));
            this.btnSearchMasLoc.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchMasLoc.Size")));
            this.btnSearchMasLoc.TabIndex = ((int)(resources.GetObject("btnSearchMasLoc.TabIndex")));
            this.btnSearchMasLoc.Text = resources.GetString("btnSearchMasLoc.Text");
            this.btnSearchMasLoc.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchMasLoc.TextAlign")));
            this.btnSearchMasLoc.Visible = ((bool)(resources.GetObject("btnSearchMasLoc.Visible")));
            this.btnSearchMasLoc.Click += new System.EventHandler(this.btnSearchMasLoc_Click);
            // 
            // dtmPostDate
            // 
            this.dtmPostDate.AcceptsEscape = ((bool)(resources.GetObject("dtmPostDate.AcceptsEscape")));
            this.dtmPostDate.AccessibleDescription = resources.GetString("dtmPostDate.AccessibleDescription");
            this.dtmPostDate.AccessibleName = resources.GetString("dtmPostDate.AccessibleName");
            this.dtmPostDate.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dtmPostDate.Anchor")));
            this.dtmPostDate.AutoSize = ((bool)(resources.GetObject("dtmPostDate.AutoSize")));
            this.dtmPostDate.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmPostDate.BackgroundImage")));
            this.dtmPostDate.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dtmPostDate.BorderStyle")));
            // 
            // dtmPostDate.Calendar
            // 
            this.dtmPostDate.Calendar.AccessibleDescription = resources.GetString("dtmPostDate.Calendar.AccessibleDescription");
            this.dtmPostDate.Calendar.AccessibleName = resources.GetString("dtmPostDate.Calendar.AccessibleName");
            this.dtmPostDate.Calendar.AnnuallyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.AnnuallyBoldedDates")));
            this.dtmPostDate.Calendar.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dtmPostDate.Calendar.BackgroundImage")));
            this.dtmPostDate.Calendar.BoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.BoldedDates")));
            this.dtmPostDate.Calendar.CalendarDimensions = ((System.Drawing.Size)(resources.GetObject("dtmPostDate.Calendar.CalendarDimensions")));
            this.dtmPostDate.Calendar.Enabled = ((bool)(resources.GetObject("dtmPostDate.Calendar.Enabled")));
            this.dtmPostDate.Calendar.FirstDayOfWeek = ((System.Windows.Forms.Day)(resources.GetObject("dtmPostDate.Calendar.FirstDayOfWeek")));
            this.dtmPostDate.Calendar.Font = ((System.Drawing.Font)(resources.GetObject("dtmPostDate.Calendar.Font")));
            this.dtmPostDate.Calendar.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmPostDate.Calendar.ImeMode")));
            this.dtmPostDate.Calendar.MonthlyBoldedDates = ((System.DateTime[])(resources.GetObject("dtmPostDate.Calendar.MonthlyBoldedDates")));
            this.dtmPostDate.Calendar.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmPostDate.Calendar.RightToLeft")));
            this.dtmPostDate.Calendar.ShowClearButton = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowClearButton")));
            this.dtmPostDate.Calendar.ShowTodayButton = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowTodayButton")));
            this.dtmPostDate.Calendar.ShowWeekNumbers = ((bool)(resources.GetObject("dtmPostDate.Calendar.ShowWeekNumbers")));
            this.dtmPostDate.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.CaseSensitive")));
            this.dtmPostDate.Culture = ((int)(resources.GetObject("dtmPostDate.Culture")));
            this.dtmPostDate.CurrentTimeZone = ((bool)(resources.GetObject("dtmPostDate.CurrentTimeZone")));
            this.dtmPostDate.CustomFormat = resources.GetString("dtmPostDate.CustomFormat");
            this.dtmPostDate.DaylightTimeAdjustment = ((C1.Win.C1Input.DaylightTimeAdjustmentEnum)(resources.GetObject("dtmPostDate.DaylightTimeAdjustment")));
            this.dtmPostDate.DisableOnNoData = false;
            this.dtmPostDate.DisplayFormat.CustomFormat = resources.GetString("dtmPostDate.DisplayFormat.CustomFormat");
            this.dtmPostDate.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.DisplayFormat.FormatType")));
            this.dtmPostDate.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmPostDate.DisplayFormat.Inherit")));
            this.dtmPostDate.DisplayFormat.NullText = resources.GetString("dtmPostDate.DisplayFormat.NullText");
            this.dtmPostDate.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.DisplayFormat.TrimEnd")));
            this.dtmPostDate.DisplayFormat.TrimStart = ((bool)(resources.GetObject("dtmPostDate.DisplayFormat.TrimStart")));
            this.dtmPostDate.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dtmPostDate.Dock")));
            this.dtmPostDate.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("dtmPostDate.DropDownFormAlign")));
            this.dtmPostDate.EditFormat.CustomFormat = resources.GetString("dtmPostDate.EditFormat.CustomFormat");
            this.dtmPostDate.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.EditFormat.FormatType")));
            this.dtmPostDate.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("dtmPostDate.EditFormat.Inherit")));
            this.dtmPostDate.EditFormat.NullText = resources.GetString("dtmPostDate.EditFormat.NullText");
            this.dtmPostDate.EditFormat.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.EditFormat.TrimEnd")));
            this.dtmPostDate.EditFormat.TrimStart = ((bool)(resources.GetObject("dtmPostDate.EditFormat.TrimStart")));
            this.dtmPostDate.EditMask = resources.GetString("dtmPostDate.EditMask");
            this.dtmPostDate.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.EmptyAsNull")));
            this.dtmPostDate.Enabled = ((bool)(resources.GetObject("dtmPostDate.Enabled")));
            this.dtmPostDate.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("dtmPostDate.ErrorInfo.BeepOnError")));
            this.dtmPostDate.ErrorInfo.ErrorMessage = resources.GetString("dtmPostDate.ErrorInfo.ErrorMessage");
            this.dtmPostDate.ErrorInfo.ErrorMessageCaption = resources.GetString("dtmPostDate.ErrorInfo.ErrorMessageCaption");
            this.dtmPostDate.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("dtmPostDate.ErrorInfo.ShowErrorMessage")));
            this.dtmPostDate.ErrorInfo.ValueOnError = ((object)(resources.GetObject("dtmPostDate.ErrorInfo.ValueOnError")));
            this.dtmPostDate.Font = ((System.Drawing.Font)(resources.GetObject("dtmPostDate.Font")));
            this.dtmPostDate.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.FormatType")));
            this.dtmPostDate.GapHeight = ((int)(resources.GetObject("dtmPostDate.GapHeight")));
            this.dtmPostDate.GMTOffset = ((System.TimeSpan)(resources.GetObject("dtmPostDate.GMTOffset")));
            this.dtmPostDate.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dtmPostDate.ImeMode")));
            this.dtmPostDate.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("dtmPostDate.InitialSelection")));
            this.dtmPostDate.Location = ((System.Drawing.Point)(resources.GetObject("dtmPostDate.Location")));
            this.dtmPostDate.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.AutoTabWhenFilled")));
            this.dtmPostDate.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.CaseSensitive")));
            this.dtmPostDate.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.CopyWithLiterals")));
            this.dtmPostDate.MaskInfo.EditMask = resources.GetString("dtmPostDate.MaskInfo.EditMask");
            this.dtmPostDate.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.MaskInfo.EmptyAsNull")));
            this.dtmPostDate.MaskInfo.ErrorMessage = resources.GetString("dtmPostDate.MaskInfo.ErrorMessage");
            this.dtmPostDate.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("dtmPostDate.MaskInfo.Inherit")));
            this.dtmPostDate.MaskInfo.PromptChar = ((char)(resources.GetObject("dtmPostDate.MaskInfo.PromptChar")));
            this.dtmPostDate.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("dtmPostDate.MaskInfo.ShowLiterals")));
            this.dtmPostDate.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("dtmPostDate.MaskInfo.StoredEmptyChar")));
            this.dtmPostDate.MaxLength = ((int)(resources.GetObject("dtmPostDate.MaxLength")));
            this.dtmPostDate.Name = "dtmPostDate";
            this.dtmPostDate.NullText = resources.GetString("dtmPostDate.NullText");
            this.dtmPostDate.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.CaseSensitive")));
            this.dtmPostDate.ParseInfo.CustomFormat = resources.GetString("dtmPostDate.ParseInfo.CustomFormat");
            this.dtmPostDate.ParseInfo.DateTimeStyle = ((C1.Win.C1Input.DateTimeStyleFlags)(resources.GetObject("dtmPostDate.ParseInfo.DateTimeStyle")));
            this.dtmPostDate.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.EmptyAsNull")));
            this.dtmPostDate.ParseInfo.ErrorMessage = resources.GetString("dtmPostDate.ParseInfo.ErrorMessage");
            this.dtmPostDate.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("dtmPostDate.ParseInfo.FormatType")));
            this.dtmPostDate.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("dtmPostDate.ParseInfo.Inherit")));
            this.dtmPostDate.ParseInfo.NullText = resources.GetString("dtmPostDate.ParseInfo.NullText");
            this.dtmPostDate.ParseInfo.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.TrimEnd")));
            this.dtmPostDate.ParseInfo.TrimStart = ((bool)(resources.GetObject("dtmPostDate.ParseInfo.TrimStart")));
            this.dtmPostDate.PasswordChar = ((char)(resources.GetObject("dtmPostDate.PasswordChar")));
            this.dtmPostDate.PostValidation.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.PostValidation.CaseSensitive")));
            this.dtmPostDate.PostValidation.ErrorMessage = resources.GetString("dtmPostDate.PostValidation.ErrorMessage");
            this.dtmPostDate.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("dtmPostDate.PostValidation.Inherit")));
            this.dtmPostDate.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("dtmPostDate.PostValidation.Validation")));
            this.dtmPostDate.PostValidation.Values = ((System.Array)(resources.GetObject("dtmPostDate.PostValidation.Values")));
            this.dtmPostDate.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("dtmPostDate.PostValidation.ValuesExcluded")));
            this.dtmPostDate.PreValidation.CaseSensitive = ((bool)(resources.GetObject("dtmPostDate.PreValidation.CaseSensitive")));
            this.dtmPostDate.PreValidation.ErrorMessage = resources.GetString("dtmPostDate.PreValidation.ErrorMessage");
            this.dtmPostDate.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("dtmPostDate.PreValidation.Inherit")));
            this.dtmPostDate.PreValidation.ItemSeparator = resources.GetString("dtmPostDate.PreValidation.ItemSeparator");
            this.dtmPostDate.PreValidation.PatternString = resources.GetString("dtmPostDate.PreValidation.PatternString");
            this.dtmPostDate.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("dtmPostDate.PreValidation.RegexOptions")));
            this.dtmPostDate.PreValidation.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.PreValidation.TrimEnd")));
            this.dtmPostDate.PreValidation.TrimStart = ((bool)(resources.GetObject("dtmPostDate.PreValidation.TrimStart")));
            this.dtmPostDate.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("dtmPostDate.PreValidation.Validation")));
            this.dtmPostDate.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dtmPostDate.RightToLeft")));
            this.dtmPostDate.ShowFocusRectangle = ((bool)(resources.GetObject("dtmPostDate.ShowFocusRectangle")));
            this.dtmPostDate.Size = ((System.Drawing.Size)(resources.GetObject("dtmPostDate.Size")));
            this.dtmPostDate.TabIndex = ((int)(resources.GetObject("dtmPostDate.TabIndex")));
            this.dtmPostDate.Tag = ((object)(resources.GetObject("dtmPostDate.Tag")));
            this.dtmPostDate.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("dtmPostDate.TextAlign")));
            this.dtmPostDate.TrimEnd = ((bool)(resources.GetObject("dtmPostDate.TrimEnd")));
            this.dtmPostDate.TrimStart = ((bool)(resources.GetObject("dtmPostDate.TrimStart")));
            this.dtmPostDate.UserCultureOverride = ((bool)(resources.GetObject("dtmPostDate.UserCultureOverride")));
            this.dtmPostDate.Value = ((object)(resources.GetObject("dtmPostDate.Value")));
            this.dtmPostDate.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("dtmPostDate.VerticalAlign")));
            this.dtmPostDate.Visible = ((bool)(resources.GetObject("dtmPostDate.Visible")));
            this.dtmPostDate.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("dtmPostDate.VisibleButtons")));
            // 
            // txtLocation
            // 
            this.txtLocation.AccessibleDescription = resources.GetString("txtLocation.AccessibleDescription");
            this.txtLocation.AccessibleName = resources.GetString("txtLocation.AccessibleName");
            this.txtLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtLocation.Anchor")));
            this.txtLocation.AutoSize = ((bool)(resources.GetObject("txtLocation.AutoSize")));
            this.txtLocation.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtLocation.BackgroundImage")));
            this.txtLocation.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtLocation.Dock")));
            this.txtLocation.Enabled = ((bool)(resources.GetObject("txtLocation.Enabled")));
            this.txtLocation.Font = ((System.Drawing.Font)(resources.GetObject("txtLocation.Font")));
            this.txtLocation.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtLocation.ImeMode")));
            this.txtLocation.Location = ((System.Drawing.Point)(resources.GetObject("txtLocation.Location")));
            this.txtLocation.MaxLength = ((int)(resources.GetObject("txtLocation.MaxLength")));
            this.txtLocation.Multiline = ((bool)(resources.GetObject("txtLocation.Multiline")));
            this.txtLocation.Name = "txtLocation";
            this.txtLocation.PasswordChar = ((char)(resources.GetObject("txtLocation.PasswordChar")));
            this.txtLocation.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtLocation.RightToLeft")));
            this.txtLocation.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtLocation.ScrollBars")));
            this.txtLocation.Size = ((System.Drawing.Size)(resources.GetObject("txtLocation.Size")));
            this.txtLocation.TabIndex = ((int)(resources.GetObject("txtLocation.TabIndex")));
            this.txtLocation.Text = resources.GetString("txtLocation.Text");
            this.txtLocation.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtLocation.TextAlign")));
            this.txtLocation.Visible = ((bool)(resources.GetObject("txtLocation.Visible")));
            this.txtLocation.WordWrap = ((bool)(resources.GetObject("txtLocation.WordWrap")));
            // 
            // btnSearchLocation
            // 
            this.btnSearchLocation.AccessibleDescription = resources.GetString("btnSearchLocation.AccessibleDescription");
            this.btnSearchLocation.AccessibleName = resources.GetString("btnSearchLocation.AccessibleName");
            this.btnSearchLocation.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchLocation.Anchor")));
            this.btnSearchLocation.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchLocation.BackgroundImage")));
            this.btnSearchLocation.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchLocation.Dock")));
            this.btnSearchLocation.Enabled = ((bool)(resources.GetObject("btnSearchLocation.Enabled")));
            this.btnSearchLocation.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchLocation.FlatStyle")));
            this.btnSearchLocation.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchLocation.Font")));
            this.btnSearchLocation.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchLocation.Image")));
            this.btnSearchLocation.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchLocation.ImageAlign")));
            this.btnSearchLocation.ImageIndex = ((int)(resources.GetObject("btnSearchLocation.ImageIndex")));
            this.btnSearchLocation.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchLocation.ImeMode")));
            this.btnSearchLocation.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchLocation.Location")));
            this.btnSearchLocation.Name = "btnSearchLocation";
            this.btnSearchLocation.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchLocation.RightToLeft")));
            this.btnSearchLocation.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchLocation.Size")));
            this.btnSearchLocation.TabIndex = ((int)(resources.GetObject("btnSearchLocation.TabIndex")));
            this.btnSearchLocation.Text = resources.GetString("btnSearchLocation.Text");
            this.btnSearchLocation.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchLocation.TextAlign")));
            this.btnSearchLocation.Visible = ((bool)(resources.GetObject("btnSearchLocation.Visible")));
            this.btnSearchLocation.Click += new System.EventHandler(this.btnSearchLocation_Click);
            // 
            // txtDescription
            // 
            this.txtDescription.AccessibleDescription = resources.GetString("txtDescription.AccessibleDescription");
            this.txtDescription.AccessibleName = resources.GetString("txtDescription.AccessibleName");
            this.txtDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtDescription.Anchor")));
            this.txtDescription.AutoSize = ((bool)(resources.GetObject("txtDescription.AutoSize")));
            this.txtDescription.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtDescription.BackgroundImage")));
            this.txtDescription.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtDescription.Dock")));
            this.txtDescription.Enabled = ((bool)(resources.GetObject("txtDescription.Enabled")));
            this.txtDescription.Font = ((System.Drawing.Font)(resources.GetObject("txtDescription.Font")));
            this.txtDescription.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtDescription.ImeMode")));
            this.txtDescription.Location = ((System.Drawing.Point)(resources.GetObject("txtDescription.Location")));
            this.txtDescription.MaxLength = ((int)(resources.GetObject("txtDescription.MaxLength")));
            this.txtDescription.Multiline = ((bool)(resources.GetObject("txtDescription.Multiline")));
            this.txtDescription.Name = "txtDescription";
            this.txtDescription.PasswordChar = ((char)(resources.GetObject("txtDescription.PasswordChar")));
            this.txtDescription.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtDescription.RightToLeft")));
            this.txtDescription.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtDescription.ScrollBars")));
            this.txtDescription.Size = ((System.Drawing.Size)(resources.GetObject("txtDescription.Size")));
            this.txtDescription.TabIndex = ((int)(resources.GetObject("txtDescription.TabIndex")));
            this.txtDescription.Text = resources.GetString("txtDescription.Text");
            this.txtDescription.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtDescription.TextAlign")));
            this.txtDescription.Visible = ((bool)(resources.GetObject("txtDescription.Visible")));
            this.txtDescription.WordWrap = ((bool)(resources.GetObject("txtDescription.WordWrap")));
            // 
            // btnSearchVendorByName
            // 
            this.btnSearchVendorByName.AccessibleDescription = resources.GetString("btnSearchVendorByName.AccessibleDescription");
            this.btnSearchVendorByName.AccessibleName = resources.GetString("btnSearchVendorByName.AccessibleName");
            this.btnSearchVendorByName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchVendorByName.Anchor")));
            this.btnSearchVendorByName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchVendorByName.BackgroundImage")));
            this.btnSearchVendorByName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchVendorByName.Dock")));
            this.btnSearchVendorByName.Enabled = ((bool)(resources.GetObject("btnSearchVendorByName.Enabled")));
            this.btnSearchVendorByName.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchVendorByName.FlatStyle")));
            this.btnSearchVendorByName.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchVendorByName.Font")));
            this.btnSearchVendorByName.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchVendorByName.Image")));
            this.btnSearchVendorByName.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchVendorByName.ImageAlign")));
            this.btnSearchVendorByName.ImageIndex = ((int)(resources.GetObject("btnSearchVendorByName.ImageIndex")));
            this.btnSearchVendorByName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchVendorByName.ImeMode")));
            this.btnSearchVendorByName.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchVendorByName.Location")));
            this.btnSearchVendorByName.Name = "btnSearchVendorByName";
            this.btnSearchVendorByName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchVendorByName.RightToLeft")));
            this.btnSearchVendorByName.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchVendorByName.Size")));
            this.btnSearchVendorByName.TabIndex = ((int)(resources.GetObject("btnSearchVendorByName.TabIndex")));
            this.btnSearchVendorByName.Text = resources.GetString("btnSearchVendorByName.Text");
            this.btnSearchVendorByName.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchVendorByName.TextAlign")));
            this.btnSearchVendorByName.Visible = ((bool)(resources.GetObject("btnSearchVendorByName.Visible")));
            this.btnSearchVendorByName.Click += new System.EventHandler(this.btnSearchVendorByName_Click);
            // 
            // lblDescription
            // 
            this.lblDescription.AccessibleDescription = resources.GetString("lblDescription.AccessibleDescription");
            this.lblDescription.AccessibleName = resources.GetString("lblDescription.AccessibleName");
            this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblDescription.Anchor")));
            this.lblDescription.AutoSize = ((bool)(resources.GetObject("lblDescription.AutoSize")));
            this.lblDescription.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblDescription.Dock")));
            this.lblDescription.Enabled = ((bool)(resources.GetObject("lblDescription.Enabled")));
            this.lblDescription.Font = ((System.Drawing.Font)(resources.GetObject("lblDescription.Font")));
            this.lblDescription.ForeColor = System.Drawing.SystemColors.WindowText;
            this.lblDescription.Image = ((System.Drawing.Image)(resources.GetObject("lblDescription.Image")));
            this.lblDescription.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDescription.ImageAlign")));
            this.lblDescription.ImageIndex = ((int)(resources.GetObject("lblDescription.ImageIndex")));
            this.lblDescription.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblDescription.ImeMode")));
            this.lblDescription.Location = ((System.Drawing.Point)(resources.GetObject("lblDescription.Location")));
            this.lblDescription.Name = "lblDescription";
            this.lblDescription.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblDescription.RightToLeft")));
            this.lblDescription.Size = ((System.Drawing.Size)(resources.GetObject("lblDescription.Size")));
            this.lblDescription.TabIndex = ((int)(resources.GetObject("lblDescription.TabIndex")));
            this.lblDescription.Text = resources.GetString("lblDescription.Text");
            this.lblDescription.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDescription.TextAlign")));
            this.lblDescription.Visible = ((bool)(resources.GetObject("lblDescription.Visible")));
            // 
            // txtRevision
            // 
            this.txtRevision.AccessibleDescription = resources.GetString("txtRevision.AccessibleDescription");
            this.txtRevision.AccessibleName = resources.GetString("txtRevision.AccessibleName");
            this.txtRevision.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtRevision.Anchor")));
            this.txtRevision.AutoSize = ((bool)(resources.GetObject("txtRevision.AutoSize")));
            this.txtRevision.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtRevision.BackgroundImage")));
            this.txtRevision.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtRevision.Dock")));
            this.txtRevision.Enabled = ((bool)(resources.GetObject("txtRevision.Enabled")));
            this.txtRevision.Font = ((System.Drawing.Font)(resources.GetObject("txtRevision.Font")));
            this.txtRevision.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtRevision.ImeMode")));
            this.txtRevision.Location = ((System.Drawing.Point)(resources.GetObject("txtRevision.Location")));
            this.txtRevision.MaxLength = ((int)(resources.GetObject("txtRevision.MaxLength")));
            this.txtRevision.Multiline = ((bool)(resources.GetObject("txtRevision.Multiline")));
            this.txtRevision.Name = "txtRevision";
            this.txtRevision.PasswordChar = ((char)(resources.GetObject("txtRevision.PasswordChar")));
            this.txtRevision.ReadOnly = true;
            this.txtRevision.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtRevision.RightToLeft")));
            this.txtRevision.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtRevision.ScrollBars")));
            this.txtRevision.Size = ((System.Drawing.Size)(resources.GetObject("txtRevision.Size")));
            this.txtRevision.TabIndex = ((int)(resources.GetObject("txtRevision.TabIndex")));
            this.txtRevision.Text = resources.GetString("txtRevision.Text");
            this.txtRevision.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtRevision.TextAlign")));
            this.txtRevision.Visible = ((bool)(resources.GetObject("txtRevision.Visible")));
            this.txtRevision.WordWrap = ((bool)(resources.GetObject("txtRevision.WordWrap")));
            // 
            // btnSearchDescription
            // 
            this.btnSearchDescription.AccessibleDescription = resources.GetString("btnSearchDescription.AccessibleDescription");
            this.btnSearchDescription.AccessibleName = resources.GetString("btnSearchDescription.AccessibleName");
            this.btnSearchDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchDescription.Anchor")));
            this.btnSearchDescription.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchDescription.BackgroundImage")));
            this.btnSearchDescription.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchDescription.Dock")));
            this.btnSearchDescription.Enabled = ((bool)(resources.GetObject("btnSearchDescription.Enabled")));
            this.btnSearchDescription.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchDescription.FlatStyle")));
            this.btnSearchDescription.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchDescription.Font")));
            this.btnSearchDescription.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchDescription.Image")));
            this.btnSearchDescription.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchDescription.ImageAlign")));
            this.btnSearchDescription.ImageIndex = ((int)(resources.GetObject("btnSearchDescription.ImageIndex")));
            this.btnSearchDescription.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchDescription.ImeMode")));
            this.btnSearchDescription.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchDescription.Location")));
            this.btnSearchDescription.Name = "btnSearchDescription";
            this.btnSearchDescription.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchDescription.RightToLeft")));
            this.btnSearchDescription.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchDescription.Size")));
            this.btnSearchDescription.TabIndex = ((int)(resources.GetObject("btnSearchDescription.TabIndex")));
            this.btnSearchDescription.Text = resources.GetString("btnSearchDescription.Text");
            this.btnSearchDescription.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchDescription.TextAlign")));
            this.btnSearchDescription.Visible = ((bool)(resources.GetObject("btnSearchDescription.Visible")));
            this.btnSearchDescription.Click += new System.EventHandler(this.btnSearchDescription_Click);
            // 
            // lblLoc
            // 
            this.lblLoc.AccessibleDescription = resources.GetString("lblLoc.AccessibleDescription");
            this.lblLoc.AccessibleName = resources.GetString("lblLoc.AccessibleName");
            this.lblLoc.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLoc.Anchor")));
            this.lblLoc.AutoSize = ((bool)(resources.GetObject("lblLoc.AutoSize")));
            this.lblLoc.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLoc.Dock")));
            this.lblLoc.Enabled = ((bool)(resources.GetObject("lblLoc.Enabled")));
            this.lblLoc.Font = ((System.Drawing.Font)(resources.GetObject("lblLoc.Font")));
            this.lblLoc.ForeColor = System.Drawing.SystemColors.WindowText;
            this.lblLoc.Image = ((System.Drawing.Image)(resources.GetObject("lblLoc.Image")));
            this.lblLoc.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLoc.ImageAlign")));
            this.lblLoc.ImageIndex = ((int)(resources.GetObject("lblLoc.ImageIndex")));
            this.lblLoc.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLoc.ImeMode")));
            this.lblLoc.Location = ((System.Drawing.Point)(resources.GetObject("lblLoc.Location")));
            this.lblLoc.Name = "lblLoc";
            this.lblLoc.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLoc.RightToLeft")));
            this.lblLoc.Size = ((System.Drawing.Size)(resources.GetObject("lblLoc.Size")));
            this.lblLoc.TabIndex = ((int)(resources.GetObject("lblLoc.TabIndex")));
            this.lblLoc.Text = resources.GetString("lblLoc.Text");
            this.lblLoc.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLoc.TextAlign")));
            this.lblLoc.Visible = ((bool)(resources.GetObject("lblLoc.Visible")));
            // 
            // lblRevision
            // 
            this.lblRevision.AccessibleDescription = resources.GetString("lblRevision.AccessibleDescription");
            this.lblRevision.AccessibleName = resources.GetString("lblRevision.AccessibleName");
            this.lblRevision.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRevision.Anchor")));
            this.lblRevision.AutoSize = ((bool)(resources.GetObject("lblRevision.AutoSize")));
            this.lblRevision.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRevision.Dock")));
            this.lblRevision.Enabled = ((bool)(resources.GetObject("lblRevision.Enabled")));
            this.lblRevision.Font = ((System.Drawing.Font)(resources.GetObject("lblRevision.Font")));
            this.lblRevision.Image = ((System.Drawing.Image)(resources.GetObject("lblRevision.Image")));
            this.lblRevision.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.ImageAlign")));
            this.lblRevision.ImageIndex = ((int)(resources.GetObject("lblRevision.ImageIndex")));
            this.lblRevision.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRevision.ImeMode")));
            this.lblRevision.Location = ((System.Drawing.Point)(resources.GetObject("lblRevision.Location")));
            this.lblRevision.Name = "lblRevision";
            this.lblRevision.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRevision.RightToLeft")));
            this.lblRevision.Size = ((System.Drawing.Size)(resources.GetObject("lblRevision.Size")));
            this.lblRevision.TabIndex = ((int)(resources.GetObject("lblRevision.TabIndex")));
            this.lblRevision.Text = resources.GetString("lblRevision.Text");
            this.lblRevision.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.TextAlign")));
            this.lblRevision.Visible = ((bool)(resources.GetObject("lblRevision.Visible")));
            // 
            // btnSearchVendorByNo
            // 
            this.btnSearchVendorByNo.AccessibleDescription = resources.GetString("btnSearchVendorByNo.AccessibleDescription");
            this.btnSearchVendorByNo.AccessibleName = resources.GetString("btnSearchVendorByNo.AccessibleName");
            this.btnSearchVendorByNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSearchVendorByNo.Anchor")));
            this.btnSearchVendorByNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSearchVendorByNo.BackgroundImage")));
            this.btnSearchVendorByNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSearchVendorByNo.Dock")));
            this.btnSearchVendorByNo.Enabled = ((bool)(resources.GetObject("btnSearchVendorByNo.Enabled")));
            this.btnSearchVendorByNo.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSearchVendorByNo.FlatStyle")));
            this.btnSearchVendorByNo.Font = ((System.Drawing.Font)(resources.GetObject("btnSearchVendorByNo.Font")));
            this.btnSearchVendorByNo.Image = ((System.Drawing.Image)(resources.GetObject("btnSearchVendorByNo.Image")));
            this.btnSearchVendorByNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchVendorByNo.ImageAlign")));
            this.btnSearchVendorByNo.ImageIndex = ((int)(resources.GetObject("btnSearchVendorByNo.ImageIndex")));
            this.btnSearchVendorByNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSearchVendorByNo.ImeMode")));
            this.btnSearchVendorByNo.Location = ((System.Drawing.Point)(resources.GetObject("btnSearchVendorByNo.Location")));
            this.btnSearchVendorByNo.Name = "btnSearchVendorByNo";
            this.btnSearchVendorByNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSearchVendorByNo.RightToLeft")));
            this.btnSearchVendorByNo.Size = ((System.Drawing.Size)(resources.GetObject("btnSearchVendorByNo.Size")));
            this.btnSearchVendorByNo.TabIndex = ((int)(resources.GetObject("btnSearchVendorByNo.TabIndex")));
            this.btnSearchVendorByNo.Text = resources.GetString("btnSearchVendorByNo.Text");
            this.btnSearchVendorByNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSearchVendorByNo.TextAlign")));
            this.btnSearchVendorByNo.Visible = ((bool)(resources.GetObject("btnSearchVendorByNo.Visible")));
            this.btnSearchVendorByNo.Click += new System.EventHandler(this.btnSearchVendorByNo_Click);
            // 
            // grbOldInfo
            // 
            this.grbOldInfo.AccessibleDescription = resources.GetString("grbOldInfo.AccessibleDescription");
            this.grbOldInfo.AccessibleName = resources.GetString("grbOldInfo.AccessibleName");
            this.grbOldInfo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("grbOldInfo.Anchor")));
            this.grbOldInfo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("grbOldInfo.BackgroundImage")));
            this.grbOldInfo.Controls.Add(this.chkRecFull);
            this.grbOldInfo.Controls.Add(this.btnSearchPO);
            this.grbOldInfo.Controls.Add(this.btnSearchLocation);
            this.grbOldInfo.Controls.Add(this.txtDescription);
            this.grbOldInfo.Controls.Add(this.lblLoc);
            this.grbOldInfo.Controls.Add(this.lblRevision);
            this.grbOldInfo.Controls.Add(this.btnSearchVendorByName);
            this.grbOldInfo.Controls.Add(this.lblDescription);
            this.grbOldInfo.Controls.Add(this.txtRevision);
            this.grbOldInfo.Controls.Add(this.txtLocation);
            this.grbOldInfo.Controls.Add(this.btnSearchDescription);
            this.grbOldInfo.Controls.Add(this.btnSearchVendorByNo);
            this.grbOldInfo.Controls.Add(this.radByPO);
            this.grbOldInfo.Controls.Add(this.txtItem);
            this.grbOldInfo.Controls.Add(this.radByItem);
            this.grbOldInfo.Controls.Add(this.btnSearchItem);
            this.grbOldInfo.Controls.Add(this.txtPurchaseNo);
            this.grbOldInfo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("grbOldInfo.Dock")));
            this.grbOldInfo.Enabled = ((bool)(resources.GetObject("grbOldInfo.Enabled")));
            this.grbOldInfo.Font = ((System.Drawing.Font)(resources.GetObject("grbOldInfo.Font")));
            this.grbOldInfo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("grbOldInfo.ImeMode")));
            this.grbOldInfo.Location = ((System.Drawing.Point)(resources.GetObject("grbOldInfo.Location")));
            this.grbOldInfo.Name = "grbOldInfo";
            this.grbOldInfo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("grbOldInfo.RightToLeft")));
            this.grbOldInfo.Size = ((System.Drawing.Size)(resources.GetObject("grbOldInfo.Size")));
            this.grbOldInfo.TabIndex = ((int)(resources.GetObject("grbOldInfo.TabIndex")));
            this.grbOldInfo.TabStop = false;
            this.grbOldInfo.Text = resources.GetString("grbOldInfo.Text");
            this.grbOldInfo.Visible = ((bool)(resources.GetObject("grbOldInfo.Visible")));
            // 
            // radBySlip
            // 
            this.radBySlip.AccessibleDescription = resources.GetString("radBySlip.AccessibleDescription");
            this.radBySlip.AccessibleName = resources.GetString("radBySlip.AccessibleName");
            this.radBySlip.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radBySlip.Anchor")));
            this.radBySlip.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radBySlip.Appearance")));
            this.radBySlip.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radBySlip.BackgroundImage")));
            this.radBySlip.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radBySlip.CheckAlign")));
            this.radBySlip.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radBySlip.Dock")));
            this.radBySlip.Enabled = ((bool)(resources.GetObject("radBySlip.Enabled")));
            this.radBySlip.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radBySlip.FlatStyle")));
            this.radBySlip.Font = ((System.Drawing.Font)(resources.GetObject("radBySlip.Font")));
            this.radBySlip.Image = ((System.Drawing.Image)(resources.GetObject("radBySlip.Image")));
            this.radBySlip.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radBySlip.ImageAlign")));
            this.radBySlip.ImageIndex = ((int)(resources.GetObject("radBySlip.ImageIndex")));
            this.radBySlip.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radBySlip.ImeMode")));
            this.radBySlip.Location = ((System.Drawing.Point)(resources.GetObject("radBySlip.Location")));
            this.radBySlip.Name = "radBySlip";
            this.radBySlip.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radBySlip.RightToLeft")));
            this.radBySlip.Size = ((System.Drawing.Size)(resources.GetObject("radBySlip.Size")));
            this.radBySlip.TabIndex = ((int)(resources.GetObject("radBySlip.TabIndex")));
            this.radBySlip.Text = resources.GetString("radBySlip.Text");
            this.radBySlip.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radBySlip.TextAlign")));
            this.radBySlip.Visible = ((bool)(resources.GetObject("radBySlip.Visible")));
            this.radBySlip.CheckedChanged += new System.EventHandler(this.radBySlip_CheckedChanged);
            // 
            // txtDeliverySlip
            // 
            this.txtDeliverySlip.AccessibleDescription = resources.GetString("txtDeliverySlip.AccessibleDescription");
            this.txtDeliverySlip.AccessibleName = resources.GetString("txtDeliverySlip.AccessibleName");
            this.txtDeliverySlip.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtDeliverySlip.Anchor")));
            this.txtDeliverySlip.AutoSize = ((bool)(resources.GetObject("txtDeliverySlip.AutoSize")));
            this.txtDeliverySlip.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtDeliverySlip.BackgroundImage")));
            this.txtDeliverySlip.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtDeliverySlip.Dock")));
            this.txtDeliverySlip.Enabled = ((bool)(resources.GetObject("txtDeliverySlip.Enabled")));
            this.txtDeliverySlip.Font = ((System.Drawing.Font)(resources.GetObject("txtDeliverySlip.Font")));
            this.txtDeliverySlip.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtDeliverySlip.ImeMode")));
            this.txtDeliverySlip.Location = ((System.Drawing.Point)(resources.GetObject("txtDeliverySlip.Location")));
            this.txtDeliverySlip.MaxLength = ((int)(resources.GetObject("txtDeliverySlip.MaxLength")));
            this.txtDeliverySlip.Multiline = ((bool)(resources.GetObject("txtDeliverySlip.Multiline")));
            this.txtDeliverySlip.Name = "txtDeliverySlip";
            this.txtDeliverySlip.PasswordChar = ((char)(resources.GetObject("txtDeliverySlip.PasswordChar")));
            this.txtDeliverySlip.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtDeliverySlip.RightToLeft")));
            this.txtDeliverySlip.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtDeliverySlip.ScrollBars")));
            this.txtDeliverySlip.Size = ((System.Drawing.Size)(resources.GetObject("txtDeliverySlip.Size")));
            this.txtDeliverySlip.TabIndex = ((int)(resources.GetObject("txtDeliverySlip.TabIndex")));
            this.txtDeliverySlip.Text = resources.GetString("txtDeliverySlip.Text");
            this.txtDeliverySlip.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtDeliverySlip.TextAlign")));
            this.txtDeliverySlip.Visible = ((bool)(resources.GetObject("txtDeliverySlip.Visible")));
            this.txtDeliverySlip.WordWrap = ((bool)(resources.GetObject("txtDeliverySlip.WordWrap")));
            // 
            // btnDeliverySlip
            // 
            this.btnDeliverySlip.AccessibleDescription = resources.GetString("btnDeliverySlip.AccessibleDescription");
            this.btnDeliverySlip.AccessibleName = resources.GetString("btnDeliverySlip.AccessibleName");
            this.btnDeliverySlip.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDeliverySlip.Anchor")));
            this.btnDeliverySlip.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDeliverySlip.BackgroundImage")));
            this.btnDeliverySlip.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDeliverySlip.Dock")));
            this.btnDeliverySlip.Enabled = ((bool)(resources.GetObject("btnDeliverySlip.Enabled")));
            this.btnDeliverySlip.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDeliverySlip.FlatStyle")));
            this.btnDeliverySlip.Font = ((System.Drawing.Font)(resources.GetObject("btnDeliverySlip.Font")));
            this.btnDeliverySlip.Image = ((System.Drawing.Image)(resources.GetObject("btnDeliverySlip.Image")));
            this.btnDeliverySlip.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDeliverySlip.ImageAlign")));
            this.btnDeliverySlip.ImageIndex = ((int)(resources.GetObject("btnDeliverySlip.ImageIndex")));
            this.btnDeliverySlip.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDeliverySlip.ImeMode")));
            this.btnDeliverySlip.Location = ((System.Drawing.Point)(resources.GetObject("btnDeliverySlip.Location")));
            this.btnDeliverySlip.Name = "btnDeliverySlip";
            this.btnDeliverySlip.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDeliverySlip.RightToLeft")));
            this.btnDeliverySlip.Size = ((System.Drawing.Size)(resources.GetObject("btnDeliverySlip.Size")));
            this.btnDeliverySlip.TabIndex = ((int)(resources.GetObject("btnDeliverySlip.TabIndex")));
            this.btnDeliverySlip.Text = resources.GetString("btnDeliverySlip.Text");
            this.btnDeliverySlip.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDeliverySlip.TextAlign")));
            this.btnDeliverySlip.Visible = ((bool)(resources.GetObject("btnDeliverySlip.Visible")));
            this.btnDeliverySlip.Click += new System.EventHandler(this.btnDeliverySlip_Click);
            // 
            // txtVendorNo
            // 
            this.txtVendorNo.AccessibleDescription = resources.GetString("txtVendorNo.AccessibleDescription");
            this.txtVendorNo.AccessibleName = resources.GetString("txtVendorNo.AccessibleName");
            this.txtVendorNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtVendorNo.Anchor")));
            this.txtVendorNo.AutoSize = ((bool)(resources.GetObject("txtVendorNo.AutoSize")));
            this.txtVendorNo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtVendorNo.BackgroundImage")));
            this.txtVendorNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtVendorNo.Dock")));
            this.txtVendorNo.Enabled = ((bool)(resources.GetObject("txtVendorNo.Enabled")));
            this.txtVendorNo.Font = ((System.Drawing.Font)(resources.GetObject("txtVendorNo.Font")));
            this.txtVendorNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtVendorNo.ImeMode")));
            this.txtVendorNo.Location = ((System.Drawing.Point)(resources.GetObject("txtVendorNo.Location")));
            this.txtVendorNo.MaxLength = ((int)(resources.GetObject("txtVendorNo.MaxLength")));
            this.txtVendorNo.Multiline = ((bool)(resources.GetObject("txtVendorNo.Multiline")));
            this.txtVendorNo.Name = "txtVendorNo";
            this.txtVendorNo.PasswordChar = ((char)(resources.GetObject("txtVendorNo.PasswordChar")));
            this.txtVendorNo.ReadOnly = true;
            this.txtVendorNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtVendorNo.RightToLeft")));
            this.txtVendorNo.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtVendorNo.ScrollBars")));
            this.txtVendorNo.Size = ((System.Drawing.Size)(resources.GetObject("txtVendorNo.Size")));
            this.txtVendorNo.TabIndex = ((int)(resources.GetObject("txtVendorNo.TabIndex")));
            this.txtVendorNo.Text = resources.GetString("txtVendorNo.Text");
            this.txtVendorNo.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtVendorNo.TextAlign")));
            this.txtVendorNo.Visible = ((bool)(resources.GetObject("txtVendorNo.Visible")));
            this.txtVendorNo.WordWrap = ((bool)(resources.GetObject("txtVendorNo.WordWrap")));
            // 
            // txtVendorName
            // 
            this.txtVendorName.AccessibleDescription = resources.GetString("txtVendorName.AccessibleDescription");
            this.txtVendorName.AccessibleName = resources.GetString("txtVendorName.AccessibleName");
            this.txtVendorName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtVendorName.Anchor")));
            this.txtVendorName.AutoSize = ((bool)(resources.GetObject("txtVendorName.AutoSize")));
            this.txtVendorName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtVendorName.BackgroundImage")));
            this.txtVendorName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtVendorName.Dock")));
            this.txtVendorName.Enabled = ((bool)(resources.GetObject("txtVendorName.Enabled")));
            this.txtVendorName.Font = ((System.Drawing.Font)(resources.GetObject("txtVendorName.Font")));
            this.txtVendorName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtVendorName.ImeMode")));
            this.txtVendorName.Location = ((System.Drawing.Point)(resources.GetObject("txtVendorName.Location")));
            this.txtVendorName.MaxLength = ((int)(resources.GetObject("txtVendorName.MaxLength")));
            this.txtVendorName.Multiline = ((bool)(resources.GetObject("txtVendorName.Multiline")));
            this.txtVendorName.Name = "txtVendorName";
            this.txtVendorName.PasswordChar = ((char)(resources.GetObject("txtVendorName.PasswordChar")));
            this.txtVendorName.ReadOnly = true;
            this.txtVendorName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtVendorName.RightToLeft")));
            this.txtVendorName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtVendorName.ScrollBars")));
            this.txtVendorName.Size = ((System.Drawing.Size)(resources.GetObject("txtVendorName.Size")));
            this.txtVendorName.TabIndex = ((int)(resources.GetObject("txtVendorName.TabIndex")));
            this.txtVendorName.Text = resources.GetString("txtVendorName.Text");
            this.txtVendorName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtVendorName.TextAlign")));
            this.txtVendorName.Visible = ((bool)(resources.GetObject("txtVendorName.Visible")));
            this.txtVendorName.WordWrap = ((bool)(resources.GetObject("txtVendorName.WordWrap")));
            // 
            // lblVenderNo
            // 
            this.lblVenderNo.AccessibleDescription = resources.GetString("lblVenderNo.AccessibleDescription");
            this.lblVenderNo.AccessibleName = resources.GetString("lblVenderNo.AccessibleName");
            this.lblVenderNo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblVenderNo.Anchor")));
            this.lblVenderNo.AutoSize = ((bool)(resources.GetObject("lblVenderNo.AutoSize")));
            this.lblVenderNo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblVenderNo.Dock")));
            this.lblVenderNo.Enabled = ((bool)(resources.GetObject("lblVenderNo.Enabled")));
            this.lblVenderNo.Font = ((System.Drawing.Font)(resources.GetObject("lblVenderNo.Font")));
            this.lblVenderNo.Image = ((System.Drawing.Image)(resources.GetObject("lblVenderNo.Image")));
            this.lblVenderNo.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblVenderNo.ImageAlign")));
            this.lblVenderNo.ImageIndex = ((int)(resources.GetObject("lblVenderNo.ImageIndex")));
            this.lblVenderNo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblVenderNo.ImeMode")));
            this.lblVenderNo.Location = ((System.Drawing.Point)(resources.GetObject("lblVenderNo.Location")));
            this.lblVenderNo.Name = "lblVenderNo";
            this.lblVenderNo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblVenderNo.RightToLeft")));
            this.lblVenderNo.Size = ((System.Drawing.Size)(resources.GetObject("lblVenderNo.Size")));
            this.lblVenderNo.TabIndex = ((int)(resources.GetObject("lblVenderNo.TabIndex")));
            this.lblVenderNo.Text = resources.GetString("lblVenderNo.Text");
            this.lblVenderNo.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblVenderNo.TextAlign")));
            this.lblVenderNo.Visible = ((bool)(resources.GetObject("lblVenderNo.Visible")));
            // 
            // txtInvoice
            // 
            this.txtInvoice.AccessibleDescription = resources.GetString("txtInvoice.AccessibleDescription");
            this.txtInvoice.AccessibleName = resources.GetString("txtInvoice.AccessibleName");
            this.txtInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtInvoice.Anchor")));
            this.txtInvoice.AutoSize = ((bool)(resources.GetObject("txtInvoice.AutoSize")));
            this.txtInvoice.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtInvoice.BackgroundImage")));
            this.txtInvoice.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtInvoice.Dock")));
            this.txtInvoice.Enabled = ((bool)(resources.GetObject("txtInvoice.Enabled")));
            this.txtInvoice.Font = ((System.Drawing.Font)(resources.GetObject("txtInvoice.Font")));
            this.txtInvoice.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtInvoice.ImeMode")));
            this.txtInvoice.Location = ((System.Drawing.Point)(resources.GetObject("txtInvoice.Location")));
            this.txtInvoice.MaxLength = ((int)(resources.GetObject("txtInvoice.MaxLength")));
            this.txtInvoice.Multiline = ((bool)(resources.GetObject("txtInvoice.Multiline")));
            this.txtInvoice.Name = "txtInvoice";
            this.txtInvoice.PasswordChar = ((char)(resources.GetObject("txtInvoice.PasswordChar")));
            this.txtInvoice.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtInvoice.RightToLeft")));
            this.txtInvoice.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtInvoice.ScrollBars")));
            this.txtInvoice.Size = ((System.Drawing.Size)(resources.GetObject("txtInvoice.Size")));
            this.txtInvoice.TabIndex = ((int)(resources.GetObject("txtInvoice.TabIndex")));
            this.txtInvoice.Text = resources.GetString("txtInvoice.Text");
            this.txtInvoice.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtInvoice.TextAlign")));
            this.txtInvoice.Visible = ((bool)(resources.GetObject("txtInvoice.Visible")));
            this.txtInvoice.WordWrap = ((bool)(resources.GetObject("txtInvoice.WordWrap")));
            // 
            // btnInvoice
            // 
            this.btnInvoice.AccessibleDescription = resources.GetString("btnInvoice.AccessibleDescription");
            this.btnInvoice.AccessibleName = resources.GetString("btnInvoice.AccessibleName");
            this.btnInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnInvoice.Anchor")));
            this.btnInvoice.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnInvoice.BackgroundImage")));
            this.btnInvoice.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnInvoice.Dock")));
            this.btnInvoice.Enabled = ((bool)(resources.GetObject("btnInvoice.Enabled")));
            this.btnInvoice.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnInvoice.FlatStyle")));
            this.btnInvoice.Font = ((System.Drawing.Font)(resources.GetObject("btnInvoice.Font")));
            this.btnInvoice.Image = ((System.Drawing.Image)(resources.GetObject("btnInvoice.Image")));
            this.btnInvoice.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnInvoice.ImageAlign")));
            this.btnInvoice.ImageIndex = ((int)(resources.GetObject("btnInvoice.ImageIndex")));
            this.btnInvoice.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnInvoice.ImeMode")));
            this.btnInvoice.Location = ((System.Drawing.Point)(resources.GetObject("btnInvoice.Location")));
            this.btnInvoice.Name = "btnInvoice";
            this.btnInvoice.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnInvoice.RightToLeft")));
            this.btnInvoice.Size = ((System.Drawing.Size)(resources.GetObject("btnInvoice.Size")));
            this.btnInvoice.TabIndex = ((int)(resources.GetObject("btnInvoice.TabIndex")));
            this.btnInvoice.Text = resources.GetString("btnInvoice.Text");
            this.btnInvoice.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnInvoice.TextAlign")));
            this.btnInvoice.Visible = ((bool)(resources.GetObject("btnInvoice.Visible")));
            this.btnInvoice.Click += new System.EventHandler(this.btnInvoice_Click);
            // 
            // radByInvoice
            // 
            this.radByInvoice.AccessibleDescription = resources.GetString("radByInvoice.AccessibleDescription");
            this.radByInvoice.AccessibleName = resources.GetString("radByInvoice.AccessibleName");
            this.radByInvoice.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radByInvoice.Anchor")));
            this.radByInvoice.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radByInvoice.Appearance")));
            this.radByInvoice.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radByInvoice.BackgroundImage")));
            this.radByInvoice.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByInvoice.CheckAlign")));
            this.radByInvoice.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radByInvoice.Dock")));
            this.radByInvoice.Enabled = ((bool)(resources.GetObject("radByInvoice.Enabled")));
            this.radByInvoice.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radByInvoice.FlatStyle")));
            this.radByInvoice.Font = ((System.Drawing.Font)(resources.GetObject("radByInvoice.Font")));
            this.radByInvoice.Image = ((System.Drawing.Image)(resources.GetObject("radByInvoice.Image")));
            this.radByInvoice.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByInvoice.ImageAlign")));
            this.radByInvoice.ImageIndex = ((int)(resources.GetObject("radByInvoice.ImageIndex")));
            this.radByInvoice.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radByInvoice.ImeMode")));
            this.radByInvoice.Location = ((System.Drawing.Point)(resources.GetObject("radByInvoice.Location")));
            this.radByInvoice.Name = "radByInvoice";
            this.radByInvoice.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radByInvoice.RightToLeft")));
            this.radByInvoice.Size = ((System.Drawing.Size)(resources.GetObject("radByInvoice.Size")));
            this.radByInvoice.TabIndex = ((int)(resources.GetObject("radByInvoice.TabIndex")));
            this.radByInvoice.Text = resources.GetString("radByInvoice.Text");
            this.radByInvoice.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radByInvoice.TextAlign")));
            this.radByInvoice.Visible = ((bool)(resources.GetObject("radByInvoice.Visible")));
            this.radByInvoice.CheckedChanged += new System.EventHandler(this.radByInvoice_CheckedChanged);
            // 
            // txtProductionLine
            // 
            this.txtProductionLine.AccessibleDescription = resources.GetString("txtProductionLine.AccessibleDescription");
            this.txtProductionLine.AccessibleName = resources.GetString("txtProductionLine.AccessibleName");
            this.txtProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtProductionLine.Anchor")));
            this.txtProductionLine.AutoSize = ((bool)(resources.GetObject("txtProductionLine.AutoSize")));
            this.txtProductionLine.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtProductionLine.BackgroundImage")));
            this.txtProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtProductionLine.Dock")));
            this.txtProductionLine.Enabled = ((bool)(resources.GetObject("txtProductionLine.Enabled")));
            this.txtProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("txtProductionLine.Font")));
            this.txtProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtProductionLine.ImeMode")));
            this.txtProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("txtProductionLine.Location")));
            this.txtProductionLine.MaxLength = ((int)(resources.GetObject("txtProductionLine.MaxLength")));
            this.txtProductionLine.Multiline = ((bool)(resources.GetObject("txtProductionLine.Multiline")));
            this.txtProductionLine.Name = "txtProductionLine";
            this.txtProductionLine.PasswordChar = ((char)(resources.GetObject("txtProductionLine.PasswordChar")));
            this.txtProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtProductionLine.RightToLeft")));
            this.txtProductionLine.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtProductionLine.ScrollBars")));
            this.txtProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("txtProductionLine.Size")));
            this.txtProductionLine.TabIndex = ((int)(resources.GetObject("txtProductionLine.TabIndex")));
            this.txtProductionLine.Text = resources.GetString("txtProductionLine.Text");
            this.txtProductionLine.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtProductionLine.TextAlign")));
            this.txtProductionLine.Visible = ((bool)(resources.GetObject("txtProductionLine.Visible")));
            this.txtProductionLine.WordWrap = ((bool)(resources.GetObject("txtProductionLine.WordWrap")));
            // 
            // txtOutside
            // 
            this.txtOutside.AccessibleDescription = resources.GetString("txtOutside.AccessibleDescription");
            this.txtOutside.AccessibleName = resources.GetString("txtOutside.AccessibleName");
            this.txtOutside.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtOutside.Anchor")));
            this.txtOutside.AutoSize = ((bool)(resources.GetObject("txtOutside.AutoSize")));
            this.txtOutside.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtOutside.BackgroundImage")));
            this.txtOutside.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtOutside.Dock")));
            this.txtOutside.Enabled = ((bool)(resources.GetObject("txtOutside.Enabled")));
            this.txtOutside.Font = ((System.Drawing.Font)(resources.GetObject("txtOutside.Font")));
            this.txtOutside.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtOutside.ImeMode")));
            this.txtOutside.Location = ((System.Drawing.Point)(resources.GetObject("txtOutside.Location")));
            this.txtOutside.MaxLength = ((int)(resources.GetObject("txtOutside.MaxLength")));
            this.txtOutside.Multiline = ((bool)(resources.GetObject("txtOutside.Multiline")));
            this.txtOutside.Name = "txtOutside";
            this.txtOutside.PasswordChar = ((char)(resources.GetObject("txtOutside.PasswordChar")));
            this.txtOutside.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtOutside.RightToLeft")));
            this.txtOutside.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtOutside.ScrollBars")));
            this.txtOutside.Size = ((System.Drawing.Size)(resources.GetObject("txtOutside.Size")));
            this.txtOutside.TabIndex = ((int)(resources.GetObject("txtOutside.TabIndex")));
            this.txtOutside.Text = resources.GetString("txtOutside.Text");
            this.txtOutside.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtOutside.TextAlign")));
            this.txtOutside.Visible = ((bool)(resources.GetObject("txtOutside.Visible")));
            this.txtOutside.WordWrap = ((bool)(resources.GetObject("txtOutside.WordWrap")));
            // 
            // btnProductionLine
            // 
            this.btnProductionLine.AccessibleDescription = resources.GetString("btnProductionLine.AccessibleDescription");
            this.btnProductionLine.AccessibleName = resources.GetString("btnProductionLine.AccessibleName");
            this.btnProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnProductionLine.Anchor")));
            this.btnProductionLine.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnProductionLine.BackgroundImage")));
            this.btnProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnProductionLine.Dock")));
            this.btnProductionLine.Enabled = ((bool)(resources.GetObject("btnProductionLine.Enabled")));
            this.btnProductionLine.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnProductionLine.FlatStyle")));
            this.btnProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("btnProductionLine.Font")));
            this.btnProductionLine.Image = ((System.Drawing.Image)(resources.GetObject("btnProductionLine.Image")));
            this.btnProductionLine.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProductionLine.ImageAlign")));
            this.btnProductionLine.ImageIndex = ((int)(resources.GetObject("btnProductionLine.ImageIndex")));
            this.btnProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnProductionLine.ImeMode")));
            this.btnProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("btnProductionLine.Location")));
            this.btnProductionLine.Name = "btnProductionLine";
            this.btnProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnProductionLine.RightToLeft")));
            this.btnProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("btnProductionLine.Size")));
            this.btnProductionLine.TabIndex = ((int)(resources.GetObject("btnProductionLine.TabIndex")));
            this.btnProductionLine.Text = resources.GetString("btnProductionLine.Text");
            this.btnProductionLine.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnProductionLine.TextAlign")));
            this.btnProductionLine.Visible = ((bool)(resources.GetObject("btnProductionLine.Visible")));
            this.btnProductionLine.Click += new System.EventHandler(this.btnProductionLine_Click);
            // 
            // lblProductionLine
            // 
            this.lblProductionLine.AccessibleDescription = resources.GetString("lblProductionLine.AccessibleDescription");
            this.lblProductionLine.AccessibleName = resources.GetString("lblProductionLine.AccessibleName");
            this.lblProductionLine.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblProductionLine.Anchor")));
            this.lblProductionLine.AutoSize = ((bool)(resources.GetObject("lblProductionLine.AutoSize")));
            this.lblProductionLine.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblProductionLine.Dock")));
            this.lblProductionLine.Enabled = ((bool)(resources.GetObject("lblProductionLine.Enabled")));
            this.lblProductionLine.Font = ((System.Drawing.Font)(resources.GetObject("lblProductionLine.Font")));
            this.lblProductionLine.ForeColor = System.Drawing.Color.Maroon;
            this.lblProductionLine.Image = ((System.Drawing.Image)(resources.GetObject("lblProductionLine.Image")));
            this.lblProductionLine.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblProductionLine.ImageAlign")));
            this.lblProductionLine.ImageIndex = ((int)(resources.GetObject("lblProductionLine.ImageIndex")));
            this.lblProductionLine.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblProductionLine.ImeMode")));
            this.lblProductionLine.Location = ((System.Drawing.Point)(resources.GetObject("lblProductionLine.Location")));
            this.lblProductionLine.Name = "lblProductionLine";
            this.lblProductionLine.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblProductionLine.RightToLeft")));
            this.lblProductionLine.Size = ((System.Drawing.Size)(resources.GetObject("lblProductionLine.Size")));
            this.lblProductionLine.TabIndex = ((int)(resources.GetObject("lblProductionLine.TabIndex")));
            this.lblProductionLine.Text = resources.GetString("lblProductionLine.Text");
            this.lblProductionLine.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblProductionLine.TextAlign")));
            this.lblProductionLine.Visible = ((bool)(resources.GetObject("lblProductionLine.Visible")));
            // 
            // btnOutside
            // 
            this.btnOutside.AccessibleDescription = resources.GetString("btnOutside.AccessibleDescription");
            this.btnOutside.AccessibleName = resources.GetString("btnOutside.AccessibleName");
            this.btnOutside.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnOutside.Anchor")));
            this.btnOutside.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOutside.BackgroundImage")));
            this.btnOutside.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnOutside.Dock")));
            this.btnOutside.Enabled = ((bool)(resources.GetObject("btnOutside.Enabled")));
            this.btnOutside.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnOutside.FlatStyle")));
            this.btnOutside.Font = ((System.Drawing.Font)(resources.GetObject("btnOutside.Font")));
            this.btnOutside.Image = ((System.Drawing.Image)(resources.GetObject("btnOutside.Image")));
            this.btnOutside.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOutside.ImageAlign")));
            this.btnOutside.ImageIndex = ((int)(resources.GetObject("btnOutside.ImageIndex")));
            this.btnOutside.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnOutside.ImeMode")));
            this.btnOutside.Location = ((System.Drawing.Point)(resources.GetObject("btnOutside.Location")));
            this.btnOutside.Name = "btnOutside";
            this.btnOutside.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnOutside.RightToLeft")));
            this.btnOutside.Size = ((System.Drawing.Size)(resources.GetObject("btnOutside.Size")));
            this.btnOutside.TabIndex = ((int)(resources.GetObject("btnOutside.TabIndex")));
            this.btnOutside.Text = resources.GetString("btnOutside.Text");
            this.btnOutside.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOutside.TextAlign")));
            this.btnOutside.Visible = ((bool)(resources.GetObject("btnOutside.Visible")));
            this.btnOutside.Click += new System.EventHandler(this.btnOutside_Click);
            // 
            // radOutside
            // 
            this.radOutside.AccessibleDescription = resources.GetString("radOutside.AccessibleDescription");
            this.radOutside.AccessibleName = resources.GetString("radOutside.AccessibleName");
            this.radOutside.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("radOutside.Anchor")));
            this.radOutside.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("radOutside.Appearance")));
            this.radOutside.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("radOutside.BackgroundImage")));
            this.radOutside.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radOutside.CheckAlign")));
            this.radOutside.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("radOutside.Dock")));
            this.radOutside.Enabled = ((bool)(resources.GetObject("radOutside.Enabled")));
            this.radOutside.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("radOutside.FlatStyle")));
            this.radOutside.Font = ((System.Drawing.Font)(resources.GetObject("radOutside.Font")));
            this.radOutside.Image = ((System.Drawing.Image)(resources.GetObject("radOutside.Image")));
            this.radOutside.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radOutside.ImageAlign")));
            this.radOutside.ImageIndex = ((int)(resources.GetObject("radOutside.ImageIndex")));
            this.radOutside.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("radOutside.ImeMode")));
            this.radOutside.Location = ((System.Drawing.Point)(resources.GetObject("radOutside.Location")));
            this.radOutside.Name = "radOutside";
            this.radOutside.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("radOutside.RightToLeft")));
            this.radOutside.Size = ((System.Drawing.Size)(resources.GetObject("radOutside.Size")));
            this.radOutside.TabIndex = ((int)(resources.GetObject("radOutside.TabIndex")));
            this.radOutside.Text = resources.GetString("radOutside.Text");
            this.radOutside.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("radOutside.TextAlign")));
            this.radOutside.Visible = ((bool)(resources.GetObject("radOutside.Visible")));
            this.radOutside.CheckedChanged += new System.EventHandler(this.radOutside_CheckedChanged);
            // 
            // btnBOMShortage
            // 
            this.btnBOMShortage.AccessibleDescription = resources.GetString("btnBOMShortage.AccessibleDescription");
            this.btnBOMShortage.AccessibleName = resources.GetString("btnBOMShortage.AccessibleName");
            this.btnBOMShortage.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnBOMShortage.Anchor")));
            this.btnBOMShortage.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnBOMShortage.BackgroundImage")));
            this.btnBOMShortage.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnBOMShortage.Dock")));
            this.btnBOMShortage.Enabled = ((bool)(resources.GetObject("btnBOMShortage.Enabled")));
            this.btnBOMShortage.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnBOMShortage.FlatStyle")));
            this.btnBOMShortage.Font = ((System.Drawing.Font)(resources.GetObject("btnBOMShortage.Font")));
            this.btnBOMShortage.Image = ((System.Drawing.Image)(resources.GetObject("btnBOMShortage.Image")));
            this.btnBOMShortage.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnBOMShortage.ImageAlign")));
            this.btnBOMShortage.ImageIndex = ((int)(resources.GetObject("btnBOMShortage.ImageIndex")));
            this.btnBOMShortage.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnBOMShortage.ImeMode")));
            this.btnBOMShortage.Location = ((System.Drawing.Point)(resources.GetObject("btnBOMShortage.Location")));
            this.btnBOMShortage.Name = "btnBOMShortage";
            this.btnBOMShortage.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnBOMShortage.RightToLeft")));
            this.btnBOMShortage.Size = ((System.Drawing.Size)(resources.GetObject("btnBOMShortage.Size")));
            this.btnBOMShortage.TabIndex = ((int)(resources.GetObject("btnBOMShortage.TabIndex")));
            this.btnBOMShortage.Text = resources.GetString("btnBOMShortage.Text");
            this.btnBOMShortage.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnBOMShortage.TextAlign")));
            this.btnBOMShortage.Visible = ((bool)(resources.GetObject("btnBOMShortage.Visible")));
            this.btnBOMShortage.Click += new System.EventHandler(this.btnBOMShortage_Click);
            // 
            // cboPurpose
            // 
            this.cboPurpose.AccessibleDescription = resources.GetString("cboPurpose.AccessibleDescription");
            this.cboPurpose.AccessibleName = resources.GetString("cboPurpose.AccessibleName");
            this.cboPurpose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboPurpose.Anchor")));
            this.cboPurpose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboPurpose.BackgroundImage")));
            this.cboPurpose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboPurpose.Dock")));
            this.cboPurpose.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.cboPurpose.Enabled = ((bool)(resources.GetObject("cboPurpose.Enabled")));
            this.cboPurpose.Font = ((System.Drawing.Font)(resources.GetObject("cboPurpose.Font")));
            this.cboPurpose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboPurpose.ImeMode")));
            this.cboPurpose.IntegralHeight = ((bool)(resources.GetObject("cboPurpose.IntegralHeight")));
            this.cboPurpose.ItemHeight = ((int)(resources.GetObject("cboPurpose.ItemHeight")));
            this.cboPurpose.Items.AddRange(new object[] {
															resources.GetString("cboPurpose.Items"),
															resources.GetString("cboPurpose.Items1")});
            this.cboPurpose.Location = ((System.Drawing.Point)(resources.GetObject("cboPurpose.Location")));
            this.cboPurpose.MaxDropDownItems = ((int)(resources.GetObject("cboPurpose.MaxDropDownItems")));
            this.cboPurpose.MaxLength = ((int)(resources.GetObject("cboPurpose.MaxLength")));
            this.cboPurpose.Name = "cboPurpose";
            this.cboPurpose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboPurpose.RightToLeft")));
            this.cboPurpose.Size = ((System.Drawing.Size)(resources.GetObject("cboPurpose.Size")));
            this.cboPurpose.TabIndex = ((int)(resources.GetObject("cboPurpose.TabIndex")));
            this.cboPurpose.Text = resources.GetString("cboPurpose.Text");
            this.cboPurpose.Visible = ((bool)(resources.GetObject("cboPurpose.Visible")));
            // 
            // label1
            // 
            this.label1.AccessibleDescription = resources.GetString("label1.AccessibleDescription");
            this.label1.AccessibleName = resources.GetString("label1.AccessibleName");
            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("label1.Anchor")));
            this.label1.AutoSize = ((bool)(resources.GetObject("label1.AutoSize")));
            this.label1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("label1.Dock")));
            this.label1.Enabled = ((bool)(resources.GetObject("label1.Enabled")));
            this.label1.Font = ((System.Drawing.Font)(resources.GetObject("label1.Font")));
            this.label1.ForeColor = System.Drawing.Color.Maroon;
            this.label1.Image = ((System.Drawing.Image)(resources.GetObject("label1.Image")));
            this.label1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.ImageAlign")));
            this.label1.ImageIndex = ((int)(resources.GetObject("label1.ImageIndex")));
            this.label1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("label1.ImeMode")));
            this.label1.Location = ((System.Drawing.Point)(resources.GetObject("label1.Location")));
            this.label1.Name = "label1";
            this.label1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("label1.RightToLeft")));
            this.label1.Size = ((System.Drawing.Size)(resources.GetObject("label1.Size")));
            this.label1.TabIndex = ((int)(resources.GetObject("label1.TabIndex")));
            this.label1.Text = resources.GetString("label1.Text");
            this.label1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("label1.TextAlign")));
            this.label1.Visible = ((bool)(resources.GetObject("label1.Visible")));
            // 
            // btnDelete
            // 
            this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
            this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
            this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
            this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
            this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
            this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
            this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
            this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
            this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
            this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
            this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
            this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
            this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
            this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
            this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
            this.btnDelete.Text = resources.GetString("btnDelete.Text");
            this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
            this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
            this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
            // 
            // btnDeleteRow
            // 
            this.btnDeleteRow.AccessibleDescription = resources.GetString("btnDeleteRow.AccessibleDescription");
            this.btnDeleteRow.AccessibleName = resources.GetString("btnDeleteRow.AccessibleName");
            this.btnDeleteRow.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDeleteRow.Anchor")));
            this.btnDeleteRow.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDeleteRow.BackgroundImage")));
            this.btnDeleteRow.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDeleteRow.Dock")));
            this.btnDeleteRow.Enabled = ((bool)(resources.GetObject("btnDeleteRow.Enabled")));
            this.btnDeleteRow.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDeleteRow.FlatStyle")));
            this.btnDeleteRow.Font = ((System.Drawing.Font)(resources.GetObject("btnDeleteRow.Font")));
            this.btnDeleteRow.Image = ((System.Drawing.Image)(resources.GetObject("btnDeleteRow.Image")));
            this.btnDeleteRow.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDeleteRow.ImageAlign")));
            this.btnDeleteRow.ImageIndex = ((int)(resources.GetObject("btnDeleteRow.ImageIndex")));
            this.btnDeleteRow.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDeleteRow.ImeMode")));
            this.btnDeleteRow.Location = ((System.Drawing.Point)(resources.GetObject("btnDeleteRow.Location")));
            this.btnDeleteRow.Name = "btnDeleteRow";
            this.btnDeleteRow.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDeleteRow.RightToLeft")));
            this.btnDeleteRow.Size = ((System.Drawing.Size)(resources.GetObject("btnDeleteRow.Size")));
            this.btnDeleteRow.TabIndex = ((int)(resources.GetObject("btnDeleteRow.TabIndex")));
            this.btnDeleteRow.Text = resources.GetString("btnDeleteRow.Text");
            this.btnDeleteRow.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDeleteRow.TextAlign")));
            this.btnDeleteRow.Visible = ((bool)(resources.GetObject("btnDeleteRow.Visible")));
            this.btnDeleteRow.Click += new System.EventHandler(this.btnDeleteRow_Click);
            // 
            // POPurchaseOrderReceipts
            // 
            this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
            this.AccessibleName = resources.GetString("$this.AccessibleName");
            this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
            this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
            this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
            this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
            this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
            this.CancelButton = this.btnClose;
            this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
            this.Controls.Add(this.btnDelete);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.cboPurpose);
            this.Controls.Add(this.btnBOMShortage);
            this.Controls.Add(this.txtProductionLine);
            this.Controls.Add(this.txtOutside);
            this.Controls.Add(this.txtVendorNo);
            this.Controls.Add(this.txtVendorName);
            this.Controls.Add(this.txtDeliverySlip);
            this.Controls.Add(this.txtMasLoc);
            this.Controls.Add(this.txtReceiveNo);
            this.Controls.Add(this.txtInvoice);
            this.Controls.Add(this.dgrdData);
            this.Controls.Add(this.lblProductionLine);
            this.Controls.Add(this.btnOutside);
            this.Controls.Add(this.dtmPostDate);
            this.Controls.Add(this.btnSearchMasLoc);
            this.Controls.Add(this.btnSearchReceive);
            this.Controls.Add(this.btnDeliverySlip);
            this.Controls.Add(this.btnInvoice);
            this.Controls.Add(this.btnProductionLine);
            this.Controls.Add(this.radOutside);
            this.Controls.Add(this.lblVenderNo);
            this.Controls.Add(this.radBySlip);
            this.Controls.Add(this.btnClose);
            this.Controls.Add(this.lblReceiveNo);
            this.Controls.Add(this.lblMasLoc);
            this.Controls.Add(this.lblPostDate);
            this.Controls.Add(this.cboCCN);
            this.Controls.Add(this.lblCCN);
            this.Controls.Add(this.btnSave);
            this.Controls.Add(this.btnAdd);
            this.Controls.Add(this.btnHelp);
            this.Controls.Add(this.btnPrint);
            this.Controls.Add(this.radByInvoice);
            this.Controls.Add(this.grbOldInfo);
            this.Controls.Add(this.btnDeleteRow);
            this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
            this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
            this.KeyPreview = true;
            this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
            this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
            this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
            this.Name = "POPurchaseOrderReceipts";
            this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
            this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
            this.Text = resources.GetString("$this.Text");
            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
            this.Closing += new System.ComponentModel.CancelEventHandler(this.POPurchaseOrderReceipts_Closing);
            this.Load += new System.EventHandler(this.POPurchaseOrderReceipts_Load);
            ((System.ComponentModel.ISupportInitialize)(this.cboCCN)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.dtmPostDate)).EndInit();
            this.grbOldInfo.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

        #region Form events

        private void POPurchaseOrderReceipts_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".POPurchaseOrderReceipts_Load()";
            try
            {
                //Set authorization for user
                Security objSecurity = new Security();
                this.Name = THIS;
                if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
                {
                    this.Close();
                    PCSMessageBox.Show(ErrorCode.MESSAGE_YOU_HAVE_NO_RIGHT_TO_VIEW, MessageBoxIcon.Warning);
                    return;
                }
                // assign event for all objects
                AssignEvent(this);
                // fill data to CCN combo
                FormControlComponents.PutDataIntoC1ComboBox(cboCCN, boUtils.ListCCN().Tables[0], MST_CCNTable.CODE_FLD, MST_CCNTable.CCNID_FLD, MST_CCNTable.TABLE_NAME);
                // set selected value to default CCN
                cboCCN.SelectedValue = SystemProperty.CCNID;
                // set value to PostDate = null
                dtmPostDate.Value = null;
                radByInvoice.Checked = true;
                dtmCurrentDate = (new UtilsBO()).GetDBDate().AddDays(1);
                // switch form mode
                SwitchFormMode();
                dtbGridLayOut = FormControlComponents.StoreGridLayout(dgrdData);
                btnInvoice.Enabled = true;
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void POPurchaseOrderReceipts_Closing(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".POPurchaseOrderReceipts_Closing()";
            try
            {
                if (mFormMode != EnumAction.Default)
                {
                    // ask user to save change
                    DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                    switch (dlgResult)
                    {
                        case DialogResult.Yes:
                            try
                            {
                                if (!CheckMandatoryFields())
                                {
                                    e.Cancel = true;
                                    break;
                                }
                                if (!SaveData())
                                {
                                    e.Cancel = true;
                                }
                            }
                            catch
                            {
                                e.Cancel = true;
                            }
                            break;
                        case DialogResult.No:
                            e.Cancel = false;
                            break;
                        case DialogResult.Cancel:
                            e.Cancel = true;
                            break;
                    }
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnSearchReceive_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchReceive_Click()";
            try
            {
                DataRowView drowData = null;
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(PO_PurchaseOrderReceiptMasterTable.TABLE_NAME, PO_PurchaseOrderReceiptMasterTable.RECEIVENO_FLD, txtReceiveNo.Text.Trim(), null, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(PO_PurchaseOrderReceiptMasterTable.TABLE_NAME, PO_PurchaseOrderReceiptMasterTable.RECEIVENO_FLD, txtReceiveNo.Text.Trim(), null, true);
                if (drowData != null)
                {
                    FillMasterData(drowData.Row);
                }
                else
                {
                    txtReceiveNo.Focus();
                    txtReceiveNo.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchMasLoc_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchMasLoc_Click()";
            try
            {
                int intCCNID = 0;
                try
                {
                    intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
                    if (intCCNID <= 0)
                        throw new Exception();
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Error);
                    cboCCN.Focus();
                    return;
                }
                DataRowView drowData = null;
                Hashtable htData = new Hashtable();
                htData.Add(MST_MasterLocationTable.CCNID_FLD, intCCNID);

                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(MST_MasterLocationTable.TABLE_NAME, MST_MasterLocationTable.CODE_FLD, txtMasLoc.Text.Trim(), htData, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(MST_MasterLocationTable.TABLE_NAME, MST_MasterLocationTable.CODE_FLD, txtMasLoc.Text.Trim(), htData, true);

                if (drowData != null)
                {
                    intMasterLocationID = int.Parse(drowData[MST_MasterLocationTable.MASTERLOCATIONID_FLD].ToString());
                    FillMasterLocationData();
                    // clear all data
                    voPOMaster = null;
                    txtPurchaseNo.Text = string.Empty;
                    txtItem.Text = string.Empty;
                    txtDescription.Text = string.Empty;
                    txtRevision.Text = string.Empty;
                    txtVendorName.Text = string.Empty;
                    txtVendorNo.Text = string.Empty;
                    txtLocation.Text = string.Empty;
                    txtInvoice.Text = string.Empty;
                    voInvoiceMaster = null;
                    txtDeliverySlip.Text = string.Empty;
                    voProduct = null;
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                }
                else
                {
                    txtMasLoc.Focus();
                    txtMasLoc.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchPO_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchPO_Click()";
            try
            {
                DataRowView drowData = null;
                // list purchase order already approved and by master location id
                if (intMasterLocationID > 0)
                {
                    Hashtable htbCondition = new Hashtable();
                    htbCondition.Add(MST_MasterLocationTable.MASTERLOCATIONID_FLD, intMasterLocationID);
                    if (sender is TextBox && sender != null)
                        drowData = FormControlComponents.OpenSearchForm(v_ApprovedAndNotCompletedPO.VIEW_NAME, PO_PurchaseOrderMasterTable.CODE_FLD, txtPurchaseNo.Text, htbCondition, false);
                    else
                        drowData = FormControlComponents.OpenSearchForm(v_ApprovedAndNotCompletedPO.VIEW_NAME, PO_PurchaseOrderMasterTable.CODE_FLD, txtPurchaseNo.Text, htbCondition, true);
                    if (drowData != null)
                    {
                        FillControlsValue(drowData.Row);
                    }
                    else
                    {
                        txtPurchaseNo.Focus();
                        txtPurchaseNo.SelectAll();
                    }
                }
                else
                {
                    // display message alert user to select master location first
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_MASTERLOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtMasLoc.Focus();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void radByPO_CheckedChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radByPO_CheckedChanged()";
            try
            {
                if (radByPO.Checked && mFormMode == EnumAction.Add)
                {
                    //Clear all the other part data
                    txtItem.Text = String.Empty;
                    txtDescription.Text = String.Empty;
                    txtRevision.Text = String.Empty;
                    txtVendorName.Text = String.Empty;
                    txtVendorNo.Text = String.Empty;
                    txtLocation.Text = String.Empty;

                    //clear all the data
                    voProduct = new ITM_Product();
                    intPartyID = 0;
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                    DisableItemRelatedControl();
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void radByItem_CheckedChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radByItem_CheckedChanged()";
            try
            {
                if (radByItem.Checked && mFormMode == EnumAction.Add)
                {
                    DisablePORelatedControl();
                    txtPurchaseNo.Text = String.Empty;
                    txtVendorName.Text = string.Empty;
                    txtVendorName.Tag = null;
                    txtVendorNo.Text = string.Empty;
                    txtVendorNo.Tag = null;
                    txtLocation.Text = string.Empty;
                    txtLocation.Tag = null;
                    voPOMaster = new PO_PurchaseOrderMasterVO();
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchItem_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchItem_Click()";
            try
            {
                // user must select CCN first
                int intCCNID = 0;
                try
                {
                    intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
                    if (intCCNID <= 0)
                        throw new Exception();
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Error);
                    cboCCN.Focus();
                    return;
                }

                blnAddManual = true;
                // if user receive by item then the Item column of grid will alway have value is the selected item
                // Allows user select PO Master that have PO Detail order Item ID in PO NO and Line column
                DataRowView drowData = null;
                Hashtable htbCondition = new Hashtable();
                htbCondition.Add(MST_CCNTable.CCNID_FLD, intCCNID);
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtItem.Text.Trim(), htbCondition, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.CODE_FLD, txtItem.Text.Trim(), htbCondition, true);
                if (drowData != null)
                {
                    FillProductData(drowData.Row, true);
                }
                else
                {
                    txtItem.Focus();
                    txtItem.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchDescription_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchDescription_Click()";
            try
            {
                // user must select CCN first
                int intCCNID = 0;
                try
                {
                    intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
                    if (intCCNID <= 0)
                        throw new Exception();
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Error);
                    cboCCN.Focus();
                    return;
                }

                blnAddManual = true;
                // if user receive by item then the Item column of grid will alway have value is the selected item
                // Allows user select PO Master that have PO Detail order Item ID in PO NO and Line column
                DataRowView drowData = null;
                Hashtable htbCondition = new Hashtable();
                htbCondition.Add(MST_CCNTable.CCNID_FLD, intCCNID);
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.DESCRIPTION_FLD, txtDescription.Text.Trim(), htbCondition, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(ITM_ProductTable.TABLE_NAME, ITM_ProductTable.DESCRIPTION_FLD, txtDescription.Text.Trim(), htbCondition, true);
                if (drowData != null)
                {
                    FillProductData(drowData.Row, true);
                }
                else
                {
                    txtDescription.Focus();
                    txtDescription.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchVendorByNo_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchVendorByNo_Click()";
            try
            {
                DataRowView drowData = null;
                Hashtable htData = new Hashtable();
                htData.Add(MST_PartyTable.DELETEREASON_FLD, 0);
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyTable.TABLE_NAME, MST_PartyTable.CODE_FLD, txtVendorNo.Text.Trim(), htData, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyTable.TABLE_NAME, MST_PartyTable.CODE_FLD, txtVendorNo.Text.Trim(), htData, true);
                if (drowData != null)
                {
                    FillVendorData(drowData.Row);
                }
                else
                {
                    txtVendorNo.Focus();
                    txtVendorNo.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchVendorByName_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchVendorByName_Click()";
            try
            {
                DataRowView drowData = null;
                Hashtable htData = new Hashtable();
                htData.Add(MST_PartyTable.DELETEREASON_FLD, 0);
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyTable.TABLE_NAME, MST_PartyTable.NAME_FLD, txtVendorName.Text.Trim(), htData, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyTable.TABLE_NAME, MST_PartyTable.NAME_FLD, txtVendorName.Text.Trim(), htData, true);
                if (drowData != null)
                {
                    FillVendorData(drowData.Row);
                }
                else
                {
                    txtVendorName.Focus();
                    txtVendorName.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSearchLocation_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSearchLocation_Click()";
            try
            {
                if (intPartyID <= 0)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_VENDOR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtVendorNo.Focus();
                    return;
                }
                DataRowView drowData = null;
                Hashtable htData = new Hashtable();
                htData.Add(MST_PartyTable.PARTYID_FLD, intPartyID);

                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyLocationTable.TABLE_NAME, MST_PartyLocationTable.CODE_FLD, txtLocation.Text.Trim(), htData, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(MST_PartyLocationTable.TABLE_NAME, MST_PartyLocationTable.CODE_FLD, txtLocation.Text.Trim(), htData, true);

                if (drowData != null)
                {
                    FillVendorLocation(drowData.Row);
                }
                else
                {
                    txtLocation.Focus();
                    txtLocation.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnAdd_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnAdd_Click()";
            try
            {
                // turn form mode to ADD
                mFormMode = EnumAction.Add;
                // clear all data
                ResetForm();
                // set value to PostDate = UtilsBO.GetDBDate()
                voPOReceiptMaster = new PO_PurchaseOrderReceiptMasterVO();
                dtmPostDate.Value = boUtils.GetDBDate();
                // fill in receive number
                //txtReceiveNo.Text = boUtils.GetNoByMask(PO_PurchaseOrderReceiptMasterTable.TABLE_NAME, PO_PurchaseOrderReceiptMasterTable.RECEIVENO_FLD, (DateTime) (dtmPostDate.Value), string.Empty);
                txtReceiveNo.Text = FormControlComponents.GetNoByMask(this);
                //Fill Default Master Location 
                FormControlComponents.SetDefaultMasterLocation(txtMasLoc);
                intMasterLocationID = SystemProperty.MasterLocationID;
                voMasterLocation.MasterLocationID = SystemProperty.MasterLocationID;
                //radBySlip.Checked = true;
                radByInvoice.Checked = true;
                //enmStatus = RadioStatus.BySlip;
                enmStatus = RadioStatus.ByInvoice;
                // switching form mode
                SwitchFormMode();
                dtmPostDate.Focus();
                dtmPostDate.SelectAll();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnSave_Click()";
            try
            {
                DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_CONFIRM_BEFORE_SAVE_DATA, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                if (dlgResult == DialogResult.No)
                    return;
                if (Security.IsDifferencePrefix(this, lblReceiveNo, txtReceiveNo))
                    return;

                if (dgrdData.EditActive)
                    return;

                if (!CheckMandatoryFields())
                    return;
                // make a copy of source dataset
                dstCopy = dstData.Copy();
                if (SaveData())
                {
                    // turn to DEFAULT mode
                    mFormMode = EnumAction.Default;
                    // get new data
                    dstData = boPOReceipt.ListReceiptDetailByReceiptMaster(voPOReceiptMaster.PurchaseOrderReceiptID);
                    // bind to grid
                    BindDataToGrid(false);
                    // switch form to DEFAULT mode
                    SwitchFormMode();
                    // display successful message
                    enmOldRadioStatus = RadioStatus.BySlip;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA, MessageBoxButtons.OK, MessageBoxIcon.Information);

                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                if (ex.mCode.Equals(ErrorCode.DUPLICATE_KEY))
                {
                    txtReceiveNo.Focus();
                    txtReceiveNo.SelectAll();
                }
                // restore the source
                dstData = new DataSet();
                dstData = dstCopy.Copy();
                BindDataToGrid(false);
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                // restore the source
                dstData = new DataSet();
                dstData = dstCopy.Copy();
                BindDataToGrid(false);
            }
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColEdit()";
            try
            {
                if (voPOReceiptMaster == null)
                {
                    return;
                }

                if (voPOReceiptMaster.PurchaseOrderReceiptID <= 0)
                {
                    return;
                }

                ShowPOSlipReport(null, null);
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnHelp_Click(object sender, EventArgs e)
        {

        }

        private void dgrdData_BeforeColEdit(object sender, BeforeColEditEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColEdit()";
            try
            {
                strSelectedValue = e.Column.DataColumn.Text;
                switch (e.Column.DataColumn.DataField)
                {
                    case (PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD):
                        if (radByPO.Checked)
                        {
                            e.Cancel = true;
                            break;
                        }
                        break;
                    case (PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD):
                        if (radByPO.Checked)
                        {
                            e.Cancel = true;
                            break;
                        }
                        break;
                    case ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD:
                        if (radByPO.Checked)
                        {
                            e.Cancel = true;
                            break;
                        }
                        // max length = 24
                        strSelectedValue = dgrdData[dgrdData.Row, ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].ToString();
                        if (strSelectedValue.Trim().Length > txtItem.MaxLength)
                        {
                            // reset value
                            dgrdData[dgrdData.Row, ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD] = strSelectedValue.Substring(0, txtItem.MaxLength);
                        }
                        break;
                    case MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD:
                        int intLocationID = 0;
                        // if current selected Location is not controlled by Bin then lock Bin cell
                        try
                        {
                            intLocationID = int.Parse(dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD].ToString());
                            if (intLocationID > 0)
                            {
                                MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(intLocationID);
                                if (voLocation.Bin)
                                    e.Column.Locked = false;
                                else
                                {
                                    e.Cancel = true;
                                    e.Column.Locked = true;
                                }
                            }
                        }
                        catch { }
                        break;
                    case PO_PurchaseOrderReceiptDetailTable.LOT_FLD:
                        int intProductID = 0;
                        // if current Item is not controlled by Lot then Lock Lot cell
                        try
                        {
                            intProductID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString().Trim());
                            if (intProductID > 0)
                            {
                                ITM_Product voCurrentProduct = new ProductItemInfoBO().GetProductInfo(intProductID);
                                bool bLotControl = voCurrentProduct.LotControl ?? false;
                                if (!bLotControl)
                                {
                                    e.Cancel = true;
                                    // lock Lot cell
                                    e.Column.Locked = true;
                                }
                                else // unlock Lot cell
                                    e.Column.Locked = false;
                            }
                        }
                        catch { }
                        break;
                    case PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD:
                        string strLot = dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD].ToString().Trim();
                        if ((strLot != null) && (strLot != string.Empty))
                        {
                            // unlock serial column
                            e.Column.Locked = false;
                        }
                        else
                        {
                            e.Cancel = true;
                            // lock serial column
                            e.Column.Locked = true;
                        }
                        break;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        
        private void dgrdData_ButtonClick(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_ButtonClick()";
            try
            {
                if (!dgrdData.AllowAddNew && !dgrdData.AllowUpdate)
                {
                    return;
                }
                // if current column is locked then return
                if (dgrdData.Splits[0].Locked || dgrdData.Splits[0].DisplayColumns[dgrdData.Col].Locked)
                    return;
                FillDataToGrid();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void dgrdData_KeyDown(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_KeyDown()";
            try
            {
                switch (e.KeyCode)
                {
                    case Keys.Delete:
                        FormControlComponents.DeleteMultiRowsOnTrueDBGrid(dgrdData);
                        int intRowCount = dgrdData.RowCount;
                        for (int i = 0; i < intRowCount; i++)
                            dgrdData[i, "ReceiptLine"] = i + 1;
                        break;
                    case Keys.F12:
                        if (!dgrdData.AllowAddNew)
                        {
                            break;
                        }
                        if (!dgrdData.Splits[0].Locked && dgrdData.AllowAddNew)
                        {
                            // save the state of column (locked or not)
                            bool blnIsLocked = dgrdData.Splits[0].DisplayColumns[dgrdData.Col].Locked;
                            // if current column is lock then unlock it, we will lock it later
                            if (blnIsLocked)
                                dgrdData.Splits[0].DisplayColumns[dgrdData.Col].Locked = false;
                            // move to last row of grid
                            dgrdData.Row = dgrdData.RowCount;
                            // set grid to EditActive mode
                            dgrdData.EditActive = true;
                            // set default UM rate
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.One;
                            // line number
                            int intMaxLine = 0;
                            if (dgrdData[dgrdData.Row, RECEIPTLINE_COL].ToString() == string.Empty)
                            {
                                // get max line number
                                if (dgrdData.Row > 0)
                                {
                                    intMaxLine = int.Parse(dgrdData[dgrdData.Row - 1, RECEIPTLINE_COL].ToString());
                                }
                                dgrdData[dgrdData.Row, RECEIPTLINE_COL] = ++intMaxLine;
                            }
                            // if receipt by PO then we assign default value for PO MasterID
                            if ((radByPO.Checked || radBySlip.Checked) && (voPOMaster.PurchaseOrderMasterID > 0))
                            {
                                // po code
                                dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD] = voPOMaster.Code;
                                // id value
                                dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD] = voPOMaster.PurchaseOrderMasterID;
                            }
                            else if ((radByItem.Checked) && (voProduct.ProductID > 0))
                            {
                                // product cdoe
                                dgrdData[dgrdData.Row, ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD] = voProduct.Code;
                                // product id value
                                dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD] = voProduct.ProductID;
                                // revision
                                dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = voProduct.Revision;
                                // description
                                dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = voProduct.Description;
                                // UM
                                MST_UnitOfMeasureVO voUM = (MST_UnitOfMeasureVO)boPOReceipt.GetUnitOfMeasureInfo(voProduct.StockUMID);
                                // stock um code
                                dgrdData[dgrdData.Row, MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD] = voUM.Code;
                                // stock um id
                                dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.STOCKUMID_FLD] = voUM.UnitOfMeasureID;
                            }

                            dgrdData.Splits[0].DisplayColumns[dgrdData.Col].Locked = blnIsLocked;

                            // set focus to po line cell
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD]);
                            dgrdData.Focus();
                        }
                        break;
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void dgrdData_BeforeDelete(object sender, C1.Win.C1TrueDBGrid.CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeDelete()";
            try
            {
                // turn of auto increment mode
                dstData.Tables[0].Columns[RECEIPTLINE_COL].AutoIncrement = false;
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_AfterDelete(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterDelete()";
            try
            {
                if (dgrdData.RowCount < 1)
                    return;
                // re-assign line value
                int intCount = 0;
                for (int i = 0; i < dgrdData.RowCount; i++)
                {
                    dgrdData[i, RECEIPTLINE_COL] = ++intCount;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void chkRecFull_CheckedChanged(object sender, EventArgs e)
        {
            blnAddManual = chkRecFull.Checked;
        }
        #endregion

        #region Private methods

        #region PO Slip Report & BOM Shortate Report: Tuan TQ.

        /// <summary>
        /// Build and show PO Slip Report
        /// </summary>
        /// <Author> Tuan TQ, 10 Apr, 2006</Author>
        private void ShowPOSlipReport(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".ShowPOSlipReport()";
            try
            {
                const string APPLICATION_PATH = @"PCSMain\bin\Debug";

                const string REPORT_LAYOUT = "PurchasingReceiptSlip.xml";
                const string REPORT_COMPANY_FLD = "fldCompany";
                const string RPT_TITLE_FLD = "fldTitle";
                const string RPT_INVOICE_NO_FLD = "fldInvoiceNo";

                this.Cursor = Cursors.WaitCursor;
                C1PrintPreviewDialog printPreview = new C1PrintPreviewDialog();
                C1PrintPreviewDialogBO boReport = new C1PrintPreviewDialogBO();

                DataTable dtbResult = boReport.GetPOSlipData(voPOReceiptMaster.PurchaseOrderReceiptID);

                // Check data source
                if (dtbResult == null)
                {
                    this.Cursor = Cursors.Default;
                    return;
                }

                ReportBuilder reportBuilder = new ReportBuilder();

                //Get actual application path
                string strReportPath = Application.StartupPath;
                int intIndex = strReportPath.IndexOf(APPLICATION_PATH);
                if (intIndex > -1)
                {
                    strReportPath = strReportPath.Substring(0, intIndex);
                }

                if (strReportPath.Substring(strReportPath.Length - 1) == @"\")
                {
                    strReportPath += Constants.REPORT_DEFINITION_STORE_LOCATION;
                }
                else
                {
                    strReportPath += @"\" + Constants.REPORT_DEFINITION_STORE_LOCATION;
                }

                //Set datasource and lay-out path for reports
                reportBuilder.SourceDataTable = dtbResult;
                reportBuilder.ReportDefinitionFolder = strReportPath;

                reportBuilder.ReportLayoutFile = REPORT_LAYOUT;

                //check if layout is valid
                if (reportBuilder.AnalyseLayoutFile())
                {
                    reportBuilder.UseLayoutFile = true;
                }
                else
                {
                    this.Cursor = Cursors.Default;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_REPORT_TEMPLATE_FILE_NOT_FOUND, MessageBoxIcon.Error);
                    return;
                }

                reportBuilder.MakeDataTableForRender();

                // And show it in preview dialog				
                reportBuilder.ReportViewer = printPreview.ReportViewer;
                reportBuilder.RenderReport();

                //Header information get from system params
                reportBuilder.DrawPredefinedField(REPORT_COMPANY_FLD, SystemProperty.SytemParams.Get(SystemParam.COMPANY_FULL_NAME));

                //Hide invoice caption if no invoice
                if (dtbResult.Rows.Count > 0)
                {
                    reportBuilder.Report.Fields[RPT_INVOICE_NO_FLD].Visible = (dtbResult.Rows[0][PO_InvoiceMasterTable.INVOICENO_FLD].ToString().Trim() != string.Empty);
                }

                reportBuilder.RefreshReport();

                //Print report
                try
                {
                    printPreview.FormTitle = reportBuilder.GetFieldByName(RPT_TITLE_FLD).Text;
                }
                catch
                { }

                printPreview.Show();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }

        private DataTable GetBOMShortageData()
        {
            const string RECEIVE_QUANTITY_FLD = "ReceiveQuantity";
            const string SHORTAGE_QUANTITY_FLD = "ShortageQuantity";

            int intProductionLineID = int.Parse(txtProductionLine.Tag.ToString());
            C1PrintPreviewDialogBO boDataReport = new C1PrintPreviewDialogBO();

            // build the list of item in the grid
            StringBuilder sbItemList = new StringBuilder();
            string strLastID = string.Empty;
            foreach (DataRow drowData in dstData.Tables[0].Rows)
            {
                string strProductID = drowData[PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString();
                if (strLastID == strProductID)
                    continue;
                strLastID = strProductID;
                sbItemList.Append(strProductID).Append(",");
            }
            sbItemList.Append("0"); // avoid exception
            DataTable dtbResult;
            dtbResult = boDataReport.GetPOBOMShortageData(dtmCurrentDate, intProductionLineID, strPONumber, sbItemList.ToString());

            if (dtbResult == null)
            {
                return null;
            }

            //Loop and fill receive quantity
            foreach (DataRow drow in dtbResult.Rows)
            {
                //Find in data source (data in grid)
                string strCondition = PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD + "=" + drow[PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString();
                DataRow[] arrMatchedRows = dstData.Tables[0].Select(strCondition);
                if (arrMatchedRows.Length != 0)
                {
                    drow[RECEIVE_QUANTITY_FLD] = arrMatchedRows[0][RECEIVE_QUANTITY_FLD];
                }
            }

            //loop and delete full quantity row (Shortage is null or <= 0)			
            //			foreach(DataRow drow in dtbResult.Rows)
            //			{
            //				if(drow[SHORTAGE_QUANTITY_FLD].Equals(DBNull.Value) || drow[SHORTAGE_QUANTITY_FLD].ToString().Trim().Equals(string.Empty))
            //				{
            //					drow.Delete();
            //				}
            //				else if(decimal.Parse(drow[SHORTAGE_QUANTITY_FLD].ToString()) <= 0)
            //				{
            //					drow.Delete();
            //				}
            //			}

            return dtbResult;
        }

        /// <summary>
        /// Build and show PO BOM Shortage Report
        /// </summary>
        /// <Author> Tuan TQ, 06 Apr, 2006</Author>
        private void ShowBOMShortageReport(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".ShowPOInvoiceReport()";
            try
            {
                const string APPLICATION_PATH = @"PCSMain\bin\Debug";

                const string REPORT_LAYOUT = "POBOMShortageReport.xml";
                const string RPT_PAGE_HEADER = "PageHeader";
                const string REPORT_COMPANY_FLD = "fldCompany";
                const string RPT_TITLE_FLD = "fldTitle";
                const string RPT_PO_NO_FLD = "P0 No.";

                this.Cursor = Cursors.WaitCursor;
                C1PrintPreviewDialog printPreview = new C1PrintPreviewDialog();

                DataTable dtbResult = GetBOMShortageData();

                // Check data source
                if (dtbResult == null)
                {
                    this.Cursor = Cursors.Default;
                    return;
                }

                ReportBuilder reportBuilder = new ReportBuilder();

                //Get actual application path
                string strReportPath = Application.StartupPath;
                int intIndex = strReportPath.IndexOf(APPLICATION_PATH);
                if (intIndex > -1)
                {
                    strReportPath = strReportPath.Substring(0, intIndex);
                }

                if (strReportPath.Substring(strReportPath.Length - 1) == @"\")
                {
                    strReportPath += Constants.REPORT_DEFINITION_STORE_LOCATION;
                }
                else
                {
                    strReportPath += @"\" + Constants.REPORT_DEFINITION_STORE_LOCATION;
                }

                //Set datasource and lay-out path for reports
                reportBuilder.SourceDataTable = dtbResult;
                reportBuilder.ReportDefinitionFolder = strReportPath;

                reportBuilder.ReportLayoutFile = REPORT_LAYOUT;

                //check if layout is valid
                if (reportBuilder.AnalyseLayoutFile())
                {
                    reportBuilder.UseLayoutFile = true;
                }
                else
                {
                    this.Cursor = Cursors.Default;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_REPORT_TEMPLATE_FILE_NOT_FOUND, MessageBoxIcon.Error);
                    return;
                }

                reportBuilder.MakeDataTableForRender();

                // And show it in preview dialog				
                reportBuilder.ReportViewer = printPreview.ReportViewer;
                reportBuilder.RenderReport();

                //Header information get from system params
                reportBuilder.DrawPredefinedField(REPORT_COMPANY_FLD, SystemProperty.SytemParams.Get(SystemParam.COMPANY_FULL_NAME));

                //Draw parameters				
                System.Collections.Specialized.NameValueCollection arrParamAndValue = new System.Collections.Specialized.NameValueCollection();
                arrParamAndValue.Add(RPT_PO_NO_FLD, strPONumber);
                arrParamAndValue.Add(lblProductionLine.Text, txtProductionLine.Text);
                arrParamAndValue.Add(lblVenderNo.Text, txtVendorNo.Text + " ( " + txtVendorName.Text + ")");

                //Anchor the Parameter drawing canvas cordinate to the fldTitle
                C1.C1Report.Field fldTitle = reportBuilder.GetFieldByName(RPT_TITLE_FLD);
                double dblStartX = fldTitle.Left;
                double dblStartY = fldTitle.Top + 1.3 * fldTitle.RenderHeight;
                reportBuilder.GetSectionByName(RPT_PAGE_HEADER).CanGrow = true;
                reportBuilder.DrawParameters(reportBuilder.GetSectionByName(RPT_PAGE_HEADER), dblStartX, dblStartY, arrParamAndValue, reportBuilder.Report.Font.Size);


                reportBuilder.RefreshReport();

                //Print report
                try
                {
                    printPreview.FormTitle = reportBuilder.GetFieldByName(RPT_TITLE_FLD).Text;
                }
                catch
                { }

                printPreview.Show();
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }

        #endregion

        private void SwitchFormMode()
        {
            //			try
            //			{
            if (mFormMode == EnumAction.Add)
            {
                dgrdData.AllowAddNew = true;
                dgrdData.AllowUpdate = true;
                dgrdData.AllowDelete = true;

                dtmPostDate.Enabled = true;
                cboCCN.Enabled = true;
                txtReceiveNo.Enabled = true;
                btnSearchReceive.Enabled = false;
                txtMasLoc.Enabled = true;
                btnSearchMasLoc.Enabled = true;

                btnSearchPO.Enabled = true;

                radByPO.Enabled = true;
                radByItem.Enabled = true;
                radBySlip.Enabled = true;
                radByInvoice.Enabled = true;
                radOutside.Enabled = true;
                if (radByPO.Checked)
                {
                    DisableItemRelatedControl();
                }
                else if (radByItem.Checked)
                {
                    DisablePORelatedControl();
                }
                txtDeliverySlip.Enabled = btnDeliverySlip.Enabled = radBySlip.Checked;
                txtInvoice.Enabled = btnInvoice.Enabled = radByInvoice.Checked;
                dgrdData.Splits[0].Locked = true;
                btnAdd.Enabled = false;
                btnSave.Enabled = true;
                btnPrint.Enabled = false;
                btnDelete.Enabled = false;
                btnDeleteRow.Enabled = false;

                btnSearchPO.Enabled = true;
                cboPurpose.Enabled = true;
            }
            else if (mFormMode == EnumAction.Edit)
            {
                dgrdData.AllowAddNew = true;
                dgrdData.AllowUpdate = true;
                dgrdData.AllowDelete = true;

                dtmPostDate.Enabled = true;
                cboCCN.Enabled = true;
                txtReceiveNo.Enabled = true;
                btnSearchReceive.Enabled = true;
                txtMasLoc.Enabled = true;
                btnSearchMasLoc.Enabled = true;



                radByPO.Enabled = true;
                radByItem.Enabled = true;
                radBySlip.Enabled = true;
                radByInvoice.Enabled = true;
                if (radByPO.Checked)
                {
                    DisableItemRelatedControl();
                }
                else if (radByItem.Checked)
                {
                    DisablePORelatedControl();
                }
                txtDeliverySlip.Enabled = btnDeliverySlip.Enabled = radBySlip.Checked;
                txtInvoice.Enabled = btnInvoice.Enabled = radByInvoice.Checked;
                foreach (C1DisplayColumn dcolCol in dgrdData.Splits[0].DisplayColumns)
                {
                    if (dcolCol.DataColumn.DataField != RECEIPTLINE_COL)
                        dcolCol.Locked = false;
                }
                btnAdd.Enabled = true;
                btnSave.Enabled = true;
                btnPrint.Enabled = false;
                btnSearchPO.Enabled = true;
                btnDelete.Enabled = false;
                btnDeleteRow.Enabled = false;

                cboPurpose.Enabled = true;
            }
            else if (mFormMode == EnumAction.Default)
            {
                dgrdData.AllowAddNew = false;
                dgrdData.AllowUpdate = false;
                dgrdData.AllowDelete = false;

                dtmPostDate.Enabled = false;
                cboCCN.Enabled = false;
                txtReceiveNo.Enabled = true;
                btnSearchReceive.Enabled = true;
                txtMasLoc.Enabled = false;
                btnSearchMasLoc.Enabled = false;
                txtOutside.Enabled = btnOutside.Enabled = txtProductionLine.Enabled = btnProductionLine.Enabled = false;
                radByPO.Enabled = false;
                radByItem.Enabled = false;
                radBySlip.Enabled = false;
                radByInvoice.Enabled = false;
                radOutside.Enabled = false;
                DisableItemRelatedControl();
                txtPurchaseNo.Enabled = false;
                btnSearchPO.Enabled = false;
                chkRecFull.Enabled = false;
                if (radByPO.Checked && radByPO.Enabled)
                {
                    DisableItemRelatedControl();
                }
                if (radByItem.Checked && radByItem.Enabled)
                {
                    DisablePORelatedControl();
                }
                txtDeliverySlip.Enabled = btnDeliverySlip.Enabled = (radBySlip.Checked && radBySlip.Enabled);
                txtInvoice.Enabled = btnInvoice.Enabled = (radByInvoice.Checked && radByInvoice.Enabled);
                foreach (C1DisplayColumn dcolCol in dgrdData.Splits[0].DisplayColumns)
                {
                    dcolCol.Locked = true;
                }
                btnAdd.Enabled = true;
                btnSave.Enabled = false;

                if (voPOReceiptMaster != null && voPOReceiptMaster.PurchaseOrderReceiptID > 0)
                {
                    btnPrint.Enabled = true;
                    btnDelete.Enabled = true;
                    btnDeleteRow.Enabled = true;
                }
                else
                {
                    btnPrint.Enabled = false;
                    btnDelete.Enabled = false;
                    btnDeleteRow.Enabled = false;
                }

                btnSearchPO.Enabled = false;
                cboPurpose.Enabled = false;
            }

            //HACK: added by Tuan TQ: Enable BOM shortage button
            btnBOMShortage.Enabled = false;
            //End

            //			}
            //			catch (PCSException ex)
            //			{
            //				throw ex;
            //			}
            //			catch (Exception ex)
            //			{
            //				throw ex;
            //			}
        }
        private void ResetForm()
        {
            try
            {
                // clear all data
                voPOReceiptMaster = new PO_PurchaseOrderReceiptMasterVO();
                if ((dstData != null) && (dstData.Tables.Count > 0))
                {
                    dstData.Tables[0].Clear();
                }
                dtmPostDate.Value = DBNull.Value;//boUtils.GetDBDate();
                txtReceiveNo.Text = string.Empty;
                txtMasLoc.Text = string.Empty;
                txtPurchaseNo.Text = string.Empty;
                txtItem.Text = string.Empty;
                txtReceiveNo.Text = string.Empty;
                txtDescription.Text = string.Empty;
                txtVendorNo.Text = string.Empty;
                txtVendorName.Text = string.Empty;
                txtLocation.Text = string.Empty;
                txtDeliverySlip.Text = string.Empty;
                txtInvoice.Text = string.Empty;
                txtOutside.Text = txtProductionLine.Text = string.Empty;
                voInvoiceMaster = new PO_InvoiceMasterVO();
                cboPurpose.SelectedIndex = 0;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private bool SaveData()
        {
            // prepare data for Master Receipt
            // HACK: Trada 28-12-2005
            DateTime dtmDateOnly = (DateTime)dtmPostDate.Value;
            dtmDateOnly = new DateTime(dtmDateOnly.Year, dtmDateOnly.Month, dtmDateOnly.Day, dtmDateOnly.Hour,
                dtmDateOnly.Minute, 0);
            //voPOReceiptMaster.PostDate = (DateTime)(dtmPostDate.Value);
            voPOReceiptMaster.PostDate = dtmDateOnly;
            voPOReceiptMaster.MasterLocationID = intMasterLocationID;
            voPOReceiptMaster.CCNID = int.Parse(cboCCN.SelectedValue.ToString());
            voPOReceiptMaster.Username = SystemProperty.UserName;
            voPOReceiptMaster.LastChange = boUtils.GetDBDate();
            voPOReceiptMaster.Purpose = cboPurpose.SelectedIndex;

            // END: Trada 28-12-2005
            if (radByInvoice.Checked)
            {
                voPOReceiptMaster.ReceiptType = (int)POReceiptTypeEnum.ByInvoice;
                voPOReceiptMaster.RefNo = txtInvoice.Text.Trim();
                voPOReceiptMaster.InvoiceMasterID = Convert.ToInt32(txtInvoice.Tag);
            }
            else if (radBySlip.Checked)
            {
                voPOReceiptMaster.ReceiptType = (int)POReceiptTypeEnum.ByDeliverySlip;
                voPOReceiptMaster.RefNo = txtDeliverySlip.Text.Trim();
                voPOReceiptMaster.InvoiceMasterID = 0;
            }
            else if (radByPO.Checked)
            {
                voPOReceiptMaster.ReceiptType = (int)POReceiptTypeEnum.ByPO;
                voPOReceiptMaster.RefNo = txtPurchaseNo.Text.Trim();
            }
            else if (radOutside.Checked)
            {
                voPOReceiptMaster.ReceiptType = (int)POReceiptTypeEnum.ByOutside;
                voPOReceiptMaster.RefNo = txtOutside.Text.Trim();
                voPOReceiptMaster.InvoiceMasterID = 0;
                // added: dungla 10-04-2006, fix bug 3741 for NganNT
                voPOReceiptMaster.ProductionLineID = Convert.ToInt32(txtProductionLine.Tag);
                // Check available quantity base on BOM of ProductionLine
                PCSComMaterials.Inventory.BO.InventoryUtilsBO boIv = new InventoryUtilsBO();
                PCSComProduct.Items.BO.BomBO boBom = new BomBO();

                foreach (DataRow drow in dstData.Tables[0].Rows)
                {
                    if (drow.RowState == DataRowState.Deleted) continue;
                    DataTable dtbBom = boBom.ListBOMDetailsOfProduct(Convert.ToInt32(drow[ITM_ProductTable.PRODUCTID_FLD]));
                    foreach (DataRow drowBom in dtbBom.Rows)
                    {
                        // Get available quantity by Postdate
                        int intLocationID, intBinID;
                        DataTable dtbLocationBin = boPOReceipt.GetLocationBin(voPOReceiptMaster.ProductionLineID);
                        if (dtbLocationBin.Rows.Count == 0)
                        {
                            // Show message: You have to issue material to Outside before receipt finished goods.
                            PCSMessageBox.Show(ErrorCode.MESSAGE_ISSUE_MATERIAL_TO_OUTSIDE, MessageBoxIcon.Error);
                            //HACK: modified by Tuan TQ: Focus to Show bom shortage
                            //btnClose.Focus();
                            btnBOMShortage.Focus();
                            //End hack
                            return false;
                        }

                        intLocationID = Convert.ToInt32(dtbLocationBin.Rows[0][MST_BINTable.LOCATIONID_FLD]);
                        intBinID = Convert.ToInt32(dtbLocationBin.Rows[0][MST_BINTable.BINID_FLD]);

                        decimal decAvail = boIv.GetAvailableQtyByPostDate(dtmCurrentDate,
                            voPOReceiptMaster.CCNID,
                            voPOReceiptMaster.MasterLocationID,
                            intLocationID,
                            intBinID,
                            Convert.ToInt32(drowBom[ITM_BOMTable.COMPONENTID_FLD]));

                        decimal decBOMQty = Convert.ToDecimal(drowBom[ITM_BOMTable.QUANTITY_FLD]);
                        decimal decOrderQty = Convert.ToDecimal(drow[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);

                        if (decAvail < decOrderQty * decBOMQty)
                        {
                            // Show message: You have to issue material to Outside before receipt finished goods.
                            PCSMessageBox.Show(ErrorCode.MESSAGE_ISSUE_MATERIAL_TO_OUTSIDE, MessageBoxIcon.Exclamation);

                            //HACK: modified by Tuan TQ: Focus to Show bom shortage
                            //btnClose.Focus();
                            btnBOMShortage.Focus();
                            //End hack
                            return false;
                        }
                    }
                }
            }
            else if (radByItem.Checked)
            {
                voPOReceiptMaster.ReceiptType = (int)POReceiptTypeEnum.ByItem;
                voPOReceiptMaster.RefNo = txtItem.Text.Trim();
            }
            if (voPOMaster != null)
                voPOReceiptMaster.PurchaseOrderMasterID = voPOMaster.PurchaseOrderMasterID;

            voPOReceiptMaster.ReceiveNo = txtReceiveNo.Text.Trim();
            // synchronyze data
            FormControlComponents.SynchronyGridData(dgrdData);
            if (mFormMode == EnumAction.Add)
               // voPOReceiptMaster.PurchaseOrderReceiptID = boPOReceipt.AddMasterReceipt(voPOReceiptMaster, dstData, intCCNID, dtmCurrentDate);
                voPOReceiptMaster.PurchaseOrderReceiptID = boPOReceipt.Insert(voPOReceiptMaster, dstData, intCCNID, dtmCurrentDate);
            else if (mFormMode == EnumAction.Edit)
                boPOReceipt.UpdateMasterReceipt(voPOReceiptMaster, dstData, intCCNID);

            return true;
        }

        private void BindDataToGrid(bool pblnAddManual)
        {
            FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayOut);
            if (dstData.Tables.Count > 0)
            {
                #region store column caption
                string strLineHeader = dgrdData.Columns[RECEIPTLINE_COL].Caption;
                int intLineWidth = dgrdData.Splits[0].DisplayColumns[RECEIPTLINE_COL].Width;
                string strPONoHeader = dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Caption;
                int intPONoHeader = dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Width;
                string strPOLineHeader = dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Caption;
                int intPOLineHeader = dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Width;
                string strItemHeader = dgrdData.Columns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].Caption;
                int intItemHeader = dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].Width;
                string strMakerHeader = dgrdData.Columns[MAKER_FLD].Caption;
                int intMakerHeader = dgrdData.Splits[0].DisplayColumns[MAKER_FLD].Width;
                string strDescriptionHeader = dgrdData.Columns[ITM_ProductTable.DESCRIPTION_FLD].Caption;
                int intDescriptionHeader = dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.DESCRIPTION_FLD].Width;
                string strRevisionHeader = dgrdData.Columns[ITM_ProductTable.REVISION_FLD].Caption;
                int intRevisionHeader = dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.REVISION_FLD].Width;
                string strUMHeader = dgrdData.Columns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD].Caption;
                int intUMHeader = dgrdData.Splits[0].DisplayColumns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD].Width;
                string strReceiveHeader = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Caption;
                int intReceiveHeader = dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Width;
                string strReceivedHeader = dgrdData.Columns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Caption;
                int intReceivedHeader = dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Width;
                string strPlanHeader = dgrdData.Columns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Caption;
                int intPlanHeader = dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Width;
                string strLocationHeader = dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Caption;
                int intLocationHeader = dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Width;
                string strBinHeader = dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Caption;
                int intBinHeader = dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Width;
                string strLotHeader = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Caption;
                int intLotHeader = dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Width;
                string strSerialHeader = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Caption;
                int intSerialHeader = dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Width;
                #endregion

                // bind data
                if (pblnAddManual)
                {
                    if ((dstData != null) && (dstData.Tables.Count > 0))
                    {
                        dstData.Tables[0].Clear();
                    }
                }
                dgrdData.Style.Reset();
                // fill data into grid
                dgrdData.DataSource = dstData.Tables[0];

                #region restore column caption and setting display style
                // unlock the grid.
                dgrdData.Splits[0].Locked = false;
                foreach (C1DisplayColumn objCol in dgrdData.Splits[0].DisplayColumns)
                {
                    objCol.Visible = false;
                    objCol.Locked = true;
                    objCol.AutoSize();
                    objCol.HeadingStyle.HorizontalAlignment = C1.Win.C1TrueDBGrid.AlignHorzEnum.Center;
                }
                //
                // Line
                //
                dgrdData.Splits[0].DisplayColumns[RECEIPTLINE_COL].Visible = true;
                dgrdData.Splits[0].DisplayColumns[RECEIPTLINE_COL].Width = intLineWidth;
                dgrdData.Columns[RECEIPTLINE_COL].Caption = strLineHeader;
                //
                // PO No
                //
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Width = intPONoHeader;
                dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Caption = strPONoHeader;
                //dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Editor = txtCellValue;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                if (radByPO.Checked || radBySlip.Checked)
                {
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Button = false;
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Locked = true;
                }
                else if (radByItem.Checked)
                {
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Button = true;
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].Locked = false;
                }
                //
                // PO Line
                //
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Width = intPOLineHeader;
                dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Caption = strPOLineHeader;
                //dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Editor = txtCellValue;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                if (radByPO.Checked || radBySlip.Checked)
                {
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Button = true;
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Locked = false;
                }
                else if (radByItem.Checked)
                {
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Button = false;
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].Locked = true;
                }
                //
                // Item
                //
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].Width = intItemHeader;
                dgrdData.Columns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].Caption = strItemHeader;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                //
                // Maker
                //
                dgrdData.Splits[0].DisplayColumns[MAKER_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MAKER_FLD].Width = intMakerHeader;
                dgrdData.Columns[MAKER_FLD].Caption = strMakerHeader;
                //
                // Description
                //
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.DESCRIPTION_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.DESCRIPTION_FLD].Width = intDescriptionHeader;
                dgrdData.Columns[ITM_ProductTable.DESCRIPTION_FLD].Caption = strDescriptionHeader;
                //
                // Revision
                //
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.REVISION_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.REVISION_FLD].Width = intRevisionHeader;
                dgrdData.Columns[ITM_ProductTable.REVISION_FLD].Caption = strRevisionHeader;
                //
                // UM
                //
                dgrdData.Splits[0].DisplayColumns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD].Width = intUMHeader;
                dgrdData.Columns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD].Caption = strUMHeader;
                //
                // Receive Quantity
                //
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Width = intReceiveHeader;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Locked = false;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].HeadingStyle.ForeColor = Color.Maroon;
                dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Caption = strReceiveHeader;
                //dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Editor = txtCellValue;
                dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
                //
                // Received Quantity
                //
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Width = intReceivedHeader;
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Locked = true;
                dgrdData.Columns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].Caption = strReceivedHeader;
                dgrdData.Columns[PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
                //
                // Plan Quantity
                //
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Width = intPlanHeader;
                dgrdData.Splits[0].DisplayColumns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Locked = true;
                dgrdData.Columns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].Caption = strPlanHeader;
                dgrdData.Columns[PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
                //
                // Location
                //
                dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Width = intLocationHeader;
                dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Locked = false;
                dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].HeadingStyle.ForeColor = Color.Maroon;
                dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Caption = strLocationHeader;
                //dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Editor = txtCellValue;
                //
                // Bin
                //
                dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Width = intBinHeader;
                dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Button = true;
                dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = false;
                dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Caption = strBinHeader;
                //dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Editor = txtCellValue;
                //
                // Lot
                //
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Width = intLotHeader;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = false;
                //dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Button = false;
                dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Caption = strLotHeader;
                //dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Editor = txtCellValue;
                //
                // QAStatus
                //
                //dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Visible = true;
                //dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Width = intQAStatusHeader;
                //dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Locked = false;
                //dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Caption = strQAStatusHeader;
                //dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Editor = txtCellValue;
                //
                // Serial
                //
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Visible = true;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Width = intSerialHeader;
                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = false;
                dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Caption = strSerialHeader;
                //dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Editor = txtCellValue;

                #endregion

                AssignDefaultValue();

                // if receipt by invoice
                if (radByInvoice.Checked)
                {
                    // lock all columns first
                    foreach (C1DisplayColumn dcolData in dgrdData.Splits[0].DisplayColumns)
                    {
                        dcolData.Button = false;
                        dcolData.Locked = true;
                    }
                    // unlock quantity
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Locked = false;
                    // unlock location
                    dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Button = true;
                    dgrdData.Splits[0].DisplayColumns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].Locked = false;
                    // unlock bin
                    dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Button = true;
                    dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = false;
                    // unlock lot
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = false;
                    // unlock serial
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = false;
                    dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.QASTATUS_FLD].Visible = false;

                    // not allow user to add new line or delete a line
                    dgrdData.AllowAddNew = false;
                    dgrdData.AllowDelete = false;
                }
            }
        }

        private void AssignEvent(Control pobjControl)
        {
            foreach (Control objControl in pobjControl.Controls)
            {
                if (objControl.HasChildren)
                {
                    AssignEvent(objControl);
                }
                if (((objControl is TextBox) || (objControl is ComboBox) ||
                    (objControl is DateTimePicker) || (objControl is C1Combo) ||
                    (objControl is C1TextBox) || (objControl is C1DateEdit) ||
                    (objControl is C1NumericEdit) || (objControl is C1DropDownControl)))
                {
                    objControl.Enter += new EventHandler(this.OnEnterControl);
                    objControl.Validating += new System.ComponentModel.CancelEventHandler(Control_Validating);
                    if ((objControl.GetType().Equals(typeof(TextBox))))
                    {
                        objControl.KeyDown += new KeyEventHandler(this.OpenSearchForm);
                    }
                }
            }
        }
        private void OnEnterControl(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".OnEnterControl()";
            try
            {
                FormControlComponents.OnEnterControl(sender, e);
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void Control_Validating(object sender, CancelEventArgs e)
        {
            const string METHOD_NAME = THIS + ".Control_Validating()";
            try
            {
                // validate data if has changed
                if (sender.GetType().Equals(typeof(TextBox)))
                {
                    TextBox txtSender = (TextBox)sender;
                    if (txtSender.Modified)
                    {
                        if (txtSender.Equals(txtInvoice) && (btnInvoice.Enabled))
                        {
                            if (txtSender.Text != string.Empty)
                                btnInvoice_Click(sender, e);
                            else
                            {
                                txtVendorName.Text = string.Empty;
                                txtVendorNo.Text = string.Empty;
                                if ((dstData != null) && (dstData.Tables.Count > 0))
                                {
                                    dstData.Tables[0].Clear();
                                }
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtReceiveNo) && (btnSearchReceive.Enabled))
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchReceive_Click(sender, e);
                            else
                            {
                                ResetForm();
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtPurchaseNo) && btnSearchPO.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchPO_Click(sender, e);
                            else
                            {
                                // clear all data
                                voPOMaster = null;
                                txtPurchaseNo.Text = string.Empty;
                                txtItem.Text = string.Empty;
                                txtDescription.Text = string.Empty;
                                txtRevision.Text = string.Empty;
                                txtVendorName.Text = string.Empty;
                                txtVendorNo.Text = string.Empty;
                                txtLocation.Text = string.Empty;
                                voProduct = null;
                                if (dstData != null && dstData.Tables.Count > 0)
                                    dstData.Tables[0].Clear();
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtItem) && btnSearchItem.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchItem_Click(sender, e);
                            else
                            {
                                // clear all data
                                txtItem.Text = string.Empty;
                                txtDescription.Text = string.Empty;
                                txtRevision.Text = string.Empty;
                                voProduct = null;
                                if (dstData != null && dstData.Tables.Count > 0)
                                    dstData.Tables[0].Clear();
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtDescription) && btnSearchDescription.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchDescription_Click(sender, e);
                            else
                            {
                                // clear all data
                                txtItem.Text = string.Empty;
                                txtDescription.Text = string.Empty;
                                txtRevision.Text = string.Empty;
                                voProduct = null;
                                if (dstData != null && dstData.Tables.Count > 0)
                                    dstData.Tables[0].Clear();
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtVendorNo) && btnSearchVendorByNo.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchVendorByNo_Click(sender, e);
                            else
                            {
                                // clear all data
                                intPartyID = 0;
                                txtVendorName.Text = string.Empty;
                                txtVendorNo.Text = string.Empty;
                                txtLocation.Text = string.Empty;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtVendorName) && btnSearchVendorByName.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchVendorByName_Click(sender, e);
                            else
                            {
                                // clear all data
                                intPartyID = 0;
                                txtVendorName.Text = string.Empty;
                                txtVendorNo.Text = string.Empty;
                                txtLocation.Text = string.Empty;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtLocation) && btnSearchLocation.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchLocation_Click(sender, e);
                            else
                            {
                                // clear all data
                                txtLocation.Text = string.Empty;
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtProductionLine) && btnProductionLine.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnProductionLine_Click(sender, e);
                            else
                            {
                                // clear all data
                                btnProductionLine.Text = string.Empty;

                                //Hack: added by Tuan TQ: 06 Apr, 2006 (BOM Shortage button)
                                txtProductionLine.Tag = null;
                                btnBOMShortage.Enabled = false;
                                //End
                            }
                            //return;
                        }
                        else if (txtSender.Equals(txtMasLoc) && btnSearchMasLoc.Enabled)
                        {
                            if (txtSender.Text != string.Empty)
                                btnSearchMasLoc_Click(sender, e);
                            else
                            {
                                // clear all data
                                voMasterLocation = new MST_MasterLocationVO();
                                intMasterLocationID = 0;
                                voPOMaster = null;
                                txtPurchaseNo.Text = string.Empty;
                                txtItem.Text = string.Empty;
                                txtDescription.Text = string.Empty;
                                txtRevision.Text = string.Empty;
                                txtVendorName.Text = string.Empty;
                                txtVendorNo.Text = string.Empty;
                                txtLocation.Text = string.Empty;
                                txtOutside.Text = string.Empty;
                                txtProductionLine.Text = string.Empty;
                                voProduct = null;
                                if (dstData != null && dstData.Tables.Count > 0)
                                    dstData.Tables[0].Clear();
                                // lock grid
                                foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                                    dcolC1.Locked = true;
                            }
                            //return;
                        }
                    }
                }

                FormControlComponents.OnLeaveControl(sender, e);
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        private void OpenSearchForm(object sender, KeyEventArgs e)
        {
            const string METHOD_NAME = THIS + ".OpenSearchForm()";
            try
            {
                if (e.KeyCode == Keys.F4)
                {
                    if (sender.Equals(txtInvoice))
                    {
                        btnInvoice_Click(null, e);
                    }
                    else if (sender.Equals(txtReceiveNo))
                    {
                        btnSearchReceive_Click(null, e);
                    }
                    else if (sender.Equals(txtMasLoc))
                    {
                        btnSearchMasLoc_Click(null, e);
                    }
                    else if (sender.Equals(txtPurchaseNo))
                    {
                        btnSearchPO_Click(null, e);
                    }
                    else if (sender.Equals(txtItem))
                    {
                        btnSearchItem_Click(null, e);
                    }
                    else if (sender.Equals(txtDescription))
                    {
                        btnSearchDescription_Click(null, e);
                    }
                    else if (sender.Equals(txtVendorNo))
                    {
                        btnSearchVendorByNo_Click(null, e);
                    }
                    else if (sender.Equals(txtVendorName))
                    {
                        btnSearchVendorByName_Click(null, e);
                    }
                    else if (sender.Equals(txtLocation))
                    {
                        btnSearchLocation_Click(null, e);
                    }
                    else if (sender.Equals(txtProductionLine))
                    {
                        btnProductionLine_Click(null, e);
                    }

                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        /// <summary>
        /// This method use to fill master data when select Invoice
        /// </summary>
        /// <param name="pdrowData">Data Row</param>
        private void FillInvoiceData(DataRow pdrowData)
        {
            // get invoice master
            voInvoiceMaster = (PO_InvoiceMasterVO)boInvoice.GetObjectVO(pdrowData[PO_InvoiceMasterTable.INVOICENO_FLD].ToString());
            // get data source
            dstData = boPOReceipt.ListByInvoice(voInvoiceMaster.InvoiceMasterID);
            // fill data to form
            txtInvoice.Text = voInvoiceMaster.InvoiceNo;
            txtInvoice.Tag = voInvoiceMaster.InvoiceMasterID;
            // get vendor info
            intPartyID = voInvoiceMaster.PartyID;
            FillCustomerInfo(intPartyID);

            // fill to data grid
            if (dstData.Tables.Count > 0 && dstData.Tables[0].Rows.Count > 0)
            {
                BindDataToGrid(false);
            }
            else
            {
                if (dstData != null && dstData.Tables.Count > 0)
                {
                    dstData.Tables[0].Clear();
                }
                BindDataToGrid(false);
                // lock the grid
                dgrdData.Splits[0].Locked = true;
            }
        }
        private void FillMasterData(DataRow pdrowData)
        {
            const string PRODUCTION_LINE = "ProductionLine";
            try
            {
                // get POReceiptMasterVO object
                voPOReceiptMaster = (PO_PurchaseOrderReceiptMasterVO)boPOReceipt.GetReceiptMasterVO(int.Parse(pdrowData[PO_PurchaseOrderReceiptMasterTable.PURCHASEORDERRECEIPTID_FLD].ToString()));
                // get data source
                dstData = boPOReceipt.ListReceiptDetailByReceiptMaster(voPOReceiptMaster.PurchaseOrderReceiptID);
                // fill data to form
                txtReceiveNo.Text = voPOReceiptMaster.ReceiveNo.ToString();
                dtmPostDate.Value = voPOReceiptMaster.PostDate;
                intMasterLocationID = voPOReceiptMaster.MasterLocationID;
                cboCCN.SelectedValue = voPOReceiptMaster.CCNID;
                FillMasterLocationData();
                txtPurchaseNo.Text = txtInvoice.Text = txtDeliverySlip.Text = txtOutside.Text = txtProductionLine.Text = string.Empty;
                cboPurpose.SelectedIndex = voPOReceiptMaster.Purpose;

                switch (voPOReceiptMaster.ReceiptType)
                {
                    case (int)POReceiptTypeEnum.ByPO:
                        voPOMaster = (PO_PurchaseOrderMasterVO)(boPOReceipt.GetPOMasterVO(voPOReceiptMaster.PurchaseOrderMasterID));
                        txtPurchaseNo.Text = voPOMaster.Code;
                        // receipt by PO
                        radByPO.Checked = true;

                        //cboCCN.SelectedValue = voPOMaster.CCNID;

                        // get vendor info
                        intPartyID = voPOMaster.PartyID;
                        FillCustomerInfo(intPartyID);
                        // party location
                        MST_PartyLocationVO voPartyLocation = boPOReceipt.GetPartyLocation(voPOMaster.VendorLocID);
                        txtLocation.Text = voPartyLocation.Code;
                        break;
                    case (int)POReceiptTypeEnum.ByItem:
                        // received by Item
                        radByItem.Checked = true;
                        if (dstData.Tables.Count > 0)
                        {
                            if (dstData.Tables[0].Rows.Count > 0)
                            {
                                FillProductData(dstData.Tables[0].Rows[0], false);
                            }
                        }
                        break;
                    case (int)POReceiptTypeEnum.ByInvoice:
                        radByInvoice.Checked = true;
                        txtInvoice.Text = voPOReceiptMaster.RefNo;
                        txtDeliverySlip.Text = string.Empty;
                        // get invoice master
                        voInvoiceMaster = (PO_InvoiceMasterVO)boInvoice.GetObjectVO(voPOReceiptMaster.RefNo);
                        // get vendor info
                        intPartyID = voInvoiceMaster.PartyID;
                        FillCustomerInfo(intPartyID);
                        break;
                    case (int)POReceiptTypeEnum.ByDeliverySlip:
                        radBySlip.Checked = true;
                        txtInvoice.Text = string.Empty;
                        txtDeliverySlip.Text = voPOReceiptMaster.RefNo;
                        voPOMaster = (PO_PurchaseOrderMasterVO)(boPOReceipt.GetPOMasterVO(voPOReceiptMaster.PurchaseOrderMasterID));
                        // get vendor info
                        intPartyID = voPOMaster.PartyID;
                        FillCustomerInfo(intPartyID);
                        break;
                    case (int)POReceiptTypeEnum.ByOutside:
                        radOutside.Checked = true;
                        DataTable dtbPOReceiptMaster = boPOReceipt.GetPOReceiptMaster(voPOReceiptMaster.PurchaseOrderReceiptID);
                        //txtInvoice.Text = string.Empty;
                        txtOutside.Text = voPOReceiptMaster.RefNo;
                        txtProductionLine.Tag = voPOReceiptMaster.ProductionLineID;
                        txtProductionLine.Text = dtbPOReceiptMaster.Rows[0][PRODUCTION_LINE].ToString();
                        //voPOMaster = (PO_PurchaseOrderMasterVO) (boPOReceipt.GetPOMasterVO(voPOReceiptMaster.PurchaseOrderMasterID));
                        // get vendor info
                        //intPartyID = voPOMaster.PartyID;
                        intPartyID = Convert.ToInt32(dtbPOReceiptMaster.Rows[0][PO_PurchaseOrderMasterTable.PARTYID_FLD]);
                        FillCustomerInfo(intPartyID);
                        break;
                }

                // bind data grid
                BindDataToGrid(false);
                // turn form to Default mode for view only
                mFormMode = EnumAction.Default;
                // switch form mode
                SwitchFormMode();
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillMasterLocationData()
        {
            try
            {
                voMasterLocation = (MST_MasterLocationVO)(boPOReceipt.GetMasterLocationInfo(intMasterLocationID));
                // fill Master location info to form
                txtMasLoc.Text = voMasterLocation.Code;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillPOData(DataRow pdrowData)
        {
            try
            {
                dgrdData.EditActive = true;
                if (pdrowData != null)
                {
                    // PO Master Code
                    dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD] = pdrowData[v_PurchaseOrderOfItem.PO_CODE];
                    // PO MasterID
                    dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD] = pdrowData[PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD];
                    // fill purchase order detail information
                    FillPOLineData(pdrowData);
                }
                else
                {
                    // PO Master Code
                    dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD] = string.Empty;
                    // PO MasterID
                    dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD] = DBNull.Value;
                    // fill purchase order detail information
                    FillPOLineData(null);
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillPOLineData(DataRow pdrowData)
        {
            try
            {
                dgrdData.EditActive = true;
                if (pdrowData != null)
                {
                    // id value
                    dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD] = pdrowData[PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD];
                    // display value
                    dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD] = pdrowData[PO_PurchaseOrderDetailTable.LINE_FLD];
                    // receive quantity
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = pdrowData[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD];
                    // UM
                    dgrdData[dgrdData.Row, MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD] = pdrowData[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD];
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.STOCKUMID_FLD] = pdrowData[PO_PurchaseOrderDetailTable.STOCKUMID_FLD];
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.BUYINGUMID_FLD] = pdrowData[PO_PurchaseOrderDetailTable.BUYINGUMID_FLD];
                    if (pdrowData[PO_PurchaseOrderDetailTable.STOCKUMID_FLD].ToString() != pdrowData[PO_PurchaseOrderDetailTable.BUYINGUMID_FLD].ToString())
                    {
                        // get UM Rate
                        decimal decUMRate = boPOReceipt.GetUMRate(int.Parse(pdrowData[PO_PurchaseOrderDetailTable.BUYINGUMID_FLD].ToString()),
                                                                  int.Parse(pdrowData[PO_PurchaseOrderDetailTable.STOCKUMID_FLD].ToString()));
                        if (decUMRate > 0)
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decUMRate;
                        else
                        {
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.MinusOne;
                            // user must set UM rate first
                            //PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SET_UMRATE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            //return;
                        }
                    }
                    else
                        dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.One;
                    // if Item is not controlled by Lot, lock Lot cell
                    ITM_Product voCurrentProduct = new ProductItemInfoBO().GetProductInfo(int.Parse(pdrowData[ITM_ProductTable.PRODUCTID_FLD].ToString()));
                    bool bLotControl = voCurrentProduct.LotControl ?? false;
                    if (!bLotControl)
                        dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = true;
                    else
                        dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = false;
                    // get default location of item
                    if (voCurrentProduct.LocationID != null)
                    {
                        int iLocationID = voCurrentProduct.LocationID ?? 0;
                        MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(iLocationID);
                        dgrdData[dgrdData.Row, MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD] = voLocation.Code;
                        dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD] = voLocation.LocationID;
                    }
                    // get default bin of item
                    if (voCurrentProduct.BinID != null)
                    {
                        int iBinID = voCurrentProduct.BinID ?? 0;
                        MST_BINVO voBin = (MST_BINVO)boPOReceipt.GetBinInfo(iBinID);
                        dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = voBin.Code;
                        dgrdData[dgrdData.Row, MST_BINTable.LOCATIONID_FLD] = voBin.BinID;
                    }
                    // temporary, we need to assign DeliveryScheduleID value when user open search form
                    // if Receipt by schedule
                    if (radBySlip.Checked)
                        dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.DELIVERYSCHEDULEID_FLD] = pdrowData[PO_PurchaseOrderReceiptDetailTable.DELIVERYSCHEDULEID_FLD];
                    // in case of receipt by PO, we need to fill item detail when select PO detail
                    if (radByPO.Checked || radBySlip.Checked)
                    {
                        // code value
                        dgrdData[dgrdData.Row, ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD] = voCurrentProduct.Code;
                        // description value
                        dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = voCurrentProduct.Description;
                        // revision value
                        dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = voCurrentProduct.Revision;
                        // receive quantity value
                        dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = pdrowData[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD];
                        // id value
                        dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD] = voCurrentProduct.ProductID;
                    }
                }
                else
                {
                    // id value
                    dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD] = DBNull.Value;
                    // display value
                    dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD] = string.Empty;
                    // receive quantity
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = string.Empty;
                    // UM
                    dgrdData[dgrdData.Row, MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD] = string.Empty;
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.STOCKUMID_FLD] = DBNull.Value;
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.BUYINGUMID_FLD] = DBNull.Value;
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.Zero;
                    // location
                    dgrdData[dgrdData.Row, MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD] = string.Empty;
                    dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD] = DBNull.Value;
                    // bin
                    dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = string.Empty;
                    dgrdData[dgrdData.Row, MST_BINTable.LOCATIONID_FLD] = DBNull.Value;
                    // in case of receipt by PO, we need to fill item detail when select PO detail
                    if (radByPO.Checked || radBySlip.Checked)
                    {
                        // code value
                        dgrdData[dgrdData.Row, ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD] = string.Empty;
                        // description value
                        dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = string.Empty;
                        // revision value
                        dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = string.Empty;
                        // id value
                        dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD] = DBNull.Value;
                    }
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillProductData(DataRow pdrowData, bool plnIsFormSearchItem)
        {
            try
            {
                int intProductID = int.Parse(pdrowData[ITM_ProductTable.PRODUCTID_FLD].ToString());
                // get ITM_ProductVO object from ID
                voProduct = new ProductItemInfoBO().GetProductInfo(intProductID);
                txtItem.Text = voProduct.Code;
                txtRevision.Text = voProduct.Revision;
                txtDescription.Text = voProduct.Description;
                if (plnIsFormSearchItem)
                {
                    // get table schema only by product
                    dstData = boPOReceipt.ListByItem(intProductID);
                    dstData.Tables[0].Clear();
                    BindDataToGrid(blnAddManual);
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillVendorData(DataRow pdrowData)
        {
            try
            {
                // fill data to form
                intPartyID = int.Parse(pdrowData[MST_PartyTable.PARTYID_FLD].ToString());
                txtVendorName.Text = pdrowData[MST_PartyTable.NAME_FLD].ToString();
                txtVendorNo.Text = pdrowData[MST_PartyTable.CODE_FLD].ToString();
                txtVendorNo.Tag = intPartyID;
                // clear vendor location
                txtLocation.Text = string.Empty;
                txtLocation.Tag = null;
                // clear grid
                if (dstData != null && dstData.Tables.Count > 0)
                    dstData.Tables[0].Clear();
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillVendorLocation(DataRow pdrowData)
        {
            try
            {
                txtLocation.Text = pdrowData[MST_PartyLocationTable.CODE_FLD].ToString();
                txtLocation.Tag = pdrowData[MST_PartyLocationTable.PARTYLOCATIONID_FLD].ToString();
                if (dstData != null && dstData.Tables.Count > 0)
                    dstData.Tables[0].Clear();
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillLocationData(DataRow pdrowData)
        {
            try
            {
                dgrdData.EditActive = true;
                if (pdrowData != null)
                {
                    MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(int.Parse(pdrowData[MST_LocationTable.LOCATIONID_FLD].ToString()));
                    // display value
                    dgrdData[dgrdData.Row, MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD] = voLocation.Code;
                    // id
                    dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD] = voLocation.LocationID;
                    // clear bin id
                    dgrdData[dgrdData.Row, MST_BINTable.BINID_FLD] = DBNull.Value;
                    // clear bin code
                    dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = string.Empty;
                    // clear Lot
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD] = string.Empty;
                    // clear Serial
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD] = string.Empty;
                    // if select Location is not controlled by bin
                    // lock Bin cell
                    if (!voLocation.Bin)
                        dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = true;
                    else
                        dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = false;
                }
                else
                {
                    // display value
                    dgrdData[dgrdData.Row, MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD] = string.Empty;
                    // id
                    dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD] = DBNull.Value;
                    // clear bin id
                    dgrdData[dgrdData.Row, MST_BINTable.BINID_FLD] = DBNull.Value;
                    // clear bin code
                    dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = string.Empty;
                    // clear Lot
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD] = string.Empty;
                    // clear Serial
                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD] = string.Empty;
                }
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillBinData(DataRow pdrowData)
        {
            try
            {
                dgrdData.EditActive = true;
                if (pdrowData != null)
                {
                    // display value
                    dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = pdrowData[MST_BINTable.CODE_FLD];
                    // id
                    dgrdData[dgrdData.Row, MST_BINTable.BINID_FLD] = pdrowData[MST_BINTable.BINID_FLD];
                }
                else
                {
                    // display value
                    dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD] = string.Empty;
                    // id
                    dgrdData[dgrdData.Row, MST_BINTable.BINID_FLD] = DBNull.Value;
                }
                // clear Lot
                dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD] = string.Empty;
                // clear Serial
                dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD] = string.Empty;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void FillControlsValue(DataRow pdrowData)
        {
            try
            {
                // get the list of PO detail
                if (pdrowData[PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD] != null)
                {
                    int intPOMasterID = int.Parse(pdrowData[PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD].ToString());
                    // get POMasterVO object first
                    voPOMaster = (PO_PurchaseOrderMasterVO)(boPOReceipt.GetPOMasterVO(intPOMasterID));
                    // fil PO no
                    txtPurchaseNo.Text = voPOMaster.Code;
                    txtPurchaseNo.Tag = voPOMaster;
                    // get vendor info
                    intPartyID = voPOMaster.PartyID;
                    MST_Party voCustomerInfo = new PartyBO().GetParty(intPartyID, string.Empty);
                    txtVendorName.Text = voCustomerInfo.Name;
                    txtVendorNo.Text = voCustomerInfo.Code;
                    // party location
                    MST_PartyLocationVO voPartyLocation = boPOReceipt.GetPartyLocation(voPOMaster.VendorLocID);
                    txtLocation.Text = voPartyLocation.Code;
                    // get list of PO detail by master
                    dstData = boPOReceipt.ListByPOID(intPOMasterID);
                }
                blnAddManual = !chkRecFull.Checked;
                BindDataToGrid(blnAddManual);
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Fill Customer information to form
        /// </summary>
        /// <param name="pintPartyID">Party ID</param>
        private void FillCustomerInfo(int pintPartyID)
        {
            MST_Party voCustomerInfo = new PartyBO().GetParty(pintPartyID, string.Empty);
            txtVendorName.Text = voCustomerInfo.Name;
            txtVendorNo.Text = voCustomerInfo.Code;
        }
        private void DisablePORelatedControl()
        {
            try
            { // enable Item related control
                txtItem.Enabled = true;
                btnSearchItem.Enabled = true;
                txtDescription.Enabled = true;
                txtRevision.Enabled = true;
                txtVendorName.Enabled = true;
                txtVendorNo.Enabled = true;
                txtLocation.Enabled = true;
                btnSearchVendorByName.Enabled = true;
                btnSearchDescription.Enabled = true;
                btnSearchVendorByNo.Enabled = true;
                btnSearchLocation.Enabled = true;
                // disable PO related control;
                txtPurchaseNo.Enabled = false;
                btnSearchPO.Enabled = false;
                chkRecFull.Enabled = false;
            }
            catch (PCSException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void DisableItemRelatedControl()
        {
            //			try
            //			{
            bool blnEnable = radByItem.Checked;
            // disable Item related control
            txtItem.Enabled = blnEnable;
            btnSearchItem.Enabled = blnEnable;
            txtDescription.Enabled = blnEnable;
            txtRevision.Enabled = blnEnable;
            txtVendorName.Enabled = blnEnable;
            txtVendorNo.Enabled = blnEnable;
            txtLocation.Enabled = blnEnable;
            btnSearchVendorByName.Enabled = blnEnable;
            btnSearchDescription.Enabled = blnEnable;
            btnSearchVendorByNo.Enabled = blnEnable;
            btnSearchLocation.Enabled = blnEnable;
            // enable PO related control;
            txtPurchaseNo.Enabled = true;
            btnSearchPO.Enabled = true;
            chkRecFull.Enabled = (mFormMode != EnumAction.Default);
            //			}
            //			catch (PCSException ex)
            //			{
            //				throw ex;
            //			}
            //			catch (Exception ex)
            //			{
            //				throw ex;
            //			}
        }
        private void FillDataToGrid()
        {
            string strColumn = dgrdData.Columns[dgrdData.Col].DataField;
            string strValue = dgrdData.Columns[dgrdData.Col].Text.Trim();
            DataRowView drvData = null;
            Hashtable htbConditions = new Hashtable();
            int intLocationID = 0;
            
            switch (strColumn)
            {
                #region // select Purchase No
                case (PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD):
                    if (radByPO.Checked || radBySlip.Checked)
                    {
                        return;
                    }
                    // user must select master location first
                    if (voMasterLocation.Equals(null) || voMasterLocation.MasterLocationID.Equals(0))
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_MASTERLOCATION, MessageBoxIcon.Error);
                        txtMasLoc.Focus();
                        return;
                    }
                    // select all purchase order that order the selected Item from a view
                    htbConditions.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
                    htbConditions.Add(ITM_ProductTable.REVISION_FLD, voProduct.Revision);
                    htbConditions.Add(MST_MasterLocationTable.MASTERLOCATIONID_FLD, voMasterLocation.MasterLocationID);
                    // if user select vendor no, filter with vendor no
                    if (txtVendorNo.Text != string.Empty)
                        htbConditions.Add(PO_PurchaseOrderMasterTable.PARTYID_FLD, int.Parse(txtVendorNo.Tag.ToString()));
                    if (txtLocation.Text != string.Empty)
                        htbConditions.Add(PO_PurchaseOrderMasterTable.VENDORLOCID_FLD, int.Parse(txtLocation.Tag.ToString()));
                    drvData = FormControlComponents.OpenSearchForm(v_PurchaseOrderOfItem.VIEW_NAME, v_PurchaseOrderOfItem.PO_CODE, strValue, htbConditions, true);
                    if (drvData != null)
                    {
                        // we need to check for exsiting PO in the list
                        DataRow[] drowExisted = dstData.Tables[0].Select(PO_PurchaseOrderDetailTable.PURCHASEORDERMASTERID_FLD + Constants.EQUAL + drvData[PO_PurchaseOrderDetailTable.PURCHASEORDERMASTERID_FLD].ToString());
                        if (drowExisted.Length.Equals(0))
                        {
                            FillPOData(drvData.Row);
                        }
                    }
                    else
                    {
                        if (strValue != string.Empty)
                        {
                            dgrdData.Row = dgrdData.Row;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                            dgrdData.Select();
                            return;
                        }
                        else
                            FillPOData(null);
                    }
                    break;

                #endregion

                #region // select purchase order line
                case (PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD):
                    if (radByItem.Checked)
                    {
                        return;
                    }
                    if (voPOMaster == null || voPOMaster.PurchaseOrderMasterID == 0)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_PO, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        if (radByPO.Checked)
                            txtPurchaseNo.Focus();
                        else if (radBySlip.Checked)
                            txtDeliverySlip.Focus();
                        return;
                    }

                    if (radByPO.Checked)
                    {
                        htbConditions.Add(PO_PurchaseOrderDetailTable.PURCHASEORDERMASTERID_FLD, voPOMaster.PurchaseOrderMasterID);
                        drvData = FormControlComponents.OpenSearchForm(v_PurchaseOrderOfItem.VIEW_NAME, PO_PurchaseOrderDetailTable.LINE_FLD, strValue, htbConditions, true);
                    }
                    else if (radBySlip.Checked)
                    {
                        htbConditions.Add(v_PurchaseOrderOfItem.PO_CODE, voPOMaster.Code);
                        if (dtmSlipDate != DateTime.MaxValue)
                        {
                            htbConditions.Add(YEAR_FILTER, dtmSlipDate.Year);
                            htbConditions.Add(MONTH_FILTER, dtmSlipDate.Month);
                            htbConditions.Add(DAY_FILTER, dtmSlipDate.Day);
                            htbConditions.Add(HOUR_FILTER, dtmSlipDate.Hour);
                        }
                        drvData = FormControlComponents.OpenSearchForm(v_ReceiptBySchedule.VIEW_NAME, PO_PurchaseOrderDetailTable.LINE_FLD, strValue, htbConditions, true);
                    }
                    if (drvData != null)
                    {
                        string strExpression = PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD
                            + Constants.EQUAL + drvData[PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString();
                        if (radBySlip.Checked)
                            strExpression += Constants.AND + PO_DeliveryScheduleTable.DELIVERYSCHEDULEID_FLD
                                + Constants.EQUAL + drvData[PO_DeliveryScheduleTable.DELIVERYSCHEDULEID_FLD].ToString();
                        // we need to check for exsiting PO Line and delivery line in the list
                        DataRow[] drowExisted = dstData.Tables[0].Select(strExpression);
                        if (drowExisted.Length.Equals(0))
                        {
                            FillPOLineData(drvData.Row);
                        }
                    }
                    else
                    {
                        if (strValue != string.Empty)
                        {
                            dgrdData.Row = dgrdData.Row;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD]);
                            dgrdData.Select();
                            return;
                        }
                        else
                            FillPOLineData(null);
                    }
                    break;

                #endregion

                #region // select location
                case (MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD):
                    // user must select master location first
                    if (voMasterLocation.MasterLocationID <= 0)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_MASTERLOCATION, MessageBoxIcon.Error);
                        txtMasLoc.Focus();
                        return;
                    }
                    htbConditions.Add(MST_LocationTable.MASTERLOCATIONID_FLD, voMasterLocation.MasterLocationID);
                    drvData = FormControlComponents.OpenSearchForm(MST_LocationTable.TABLE_NAME, MST_LocationTable.CODE_FLD, strValue, htbConditions, true);
                    if (drvData != null)
                    {
                        FillLocationData(drvData.Row);
                    }
                    else
                    {
                        if (strValue != string.Empty)
                        {
                            dgrdData.Row = dgrdData.Row;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                            dgrdData.Select();
                            return;
                        }
                        else
                            FillLocationData(null);
                    }
                    break;

                #endregion

                #region // select bin
                case (MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD):
                    try
                    {
                        intLocationID = int.Parse(dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD].ToString());
                        // user must select location first
                        if (intLocationID <= 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                            return;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                        return;
                    }
                    MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(intLocationID);
                    if (voLocation.Bin)
                        dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = false;
                    else
                    {
                        dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = true;
                        return;
                    }
                    string strWhereClause = MST_BINTable.TABLE_NAME + "." + MST_BINTable.LOCATIONID_FLD + "=" + intLocationID;
                    //htbConditions.Add(MST_BINTable.LOCATIONID_FLD, intLocationID);
                    if (radOutside.Checked)
                    {
                        //htbConditions.Add(MST_BINTable.BINTYPEID_FLD, (int)BinTypeEnum.OK + " OR " + MST_BINTable.TABLE_NAME + ".BinTypeID = " + (int)BinTypeEnum.NG);
                        // edited dungla 10-04-2006, fix bug 3738 for ThuyPT
                        strWhereClause += " AND (" + MST_BINTable.TABLE_NAME + "." + MST_BINTable.BINTYPEID_FLD + "=" + (int)BinTypeEnum.OK
                            + " OR " + MST_BINTable.TABLE_NAME + ".BinTypeID = " + (int)BinTypeEnum.NG + ")";
                        //+ " OR " + MST_BINTable.TABLE_NAME + ".BinTypeID = " + (int)BinTypeEnum.LS + ")";
                    }
                    //drvData = FormControlComponents.OpenSearchForm(MST_BINTable.TABLE_NAME, MST_BINTable.CODE_FLD, strValue, htbConditions, true);
                    drvData = FormControlComponents.OpenSearchForm(MST_BINTable.TABLE_NAME, MST_BINTable.CODE_FLD, strValue, strWhereClause);
                    if (drvData != null)
                    {
                        FillBinData(drvData.Row);
                    }
                    else
                    {
                        if (strValue != string.Empty)
                        {
                            dgrdData.Row = dgrdData.Row;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD]);
                            dgrdData.Select();
                            return;
                        }
                        else
                            FillBinData(null);
                    }
                    break;

                #endregion
            }

        }
        /// <summary>
        /// This method uses to check all madatory fields in form.
        /// </summary>
        /// <returns>True if succeed. False if failure</returns>
        private bool CheckMandatoryFields()
        {
            // check mandatory field
            if (FormControlComponents.CheckMandatory(cboCCN))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                cboCCN.Focus();
                return false;
            }
            if (dtmPostDate.ValueIsDbNull)
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtmPostDate.Focus();
                return false;
            }

            if (!FormControlComponents.CheckDateInCurrentPeriod((DateTime)dtmPostDate.Value))
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_PKL_TRANSDATE_PERIOD, MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtmPostDate.Focus();
                return false;
            }

            //Hack: Added by Tuan TQ. 12 Jan 2006
            DateTime dtmDBDate = boUtils.GetDBDate();
            if (dtmDBDate < (DateTime)dtmPostDate.Value)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_INV_TRANSACTION_CANNOT_IN_FUTURE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                dtmPostDate.Focus();
                return false;
            }
            //End Hack

            if (FormControlComponents.CheckMandatory(txtReceiveNo))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtReceiveNo.Focus();
                return false;
            }

            if (FormControlComponents.CheckMandatory(txtMasLoc))
            {
                PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                txtMasLoc.Focus();
                return false;
            }
            // Outside
            if (txtOutside.Text != string.Empty)
                if (FormControlComponents.CheckMandatory(txtProductionLine))
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtProductionLine.Focus();
                    return false;
                }
            //Check postdate in configuration
            if (!FormControlComponents.CheckPostDateInConfiguration((DateTime)dtmPostDate.Value))
            {
                return false;
            }
            try
            {
                intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
            }
            catch { }
            // check mandatory field in grid
            int intTotalRows = dgrdData.RowCount;
            
            if (intTotalRows <= 0)
            {
                PCSMessageBox.Show(ErrorCode.MESSAGE_PORECEIPT_INPUT_DETAIL, MessageBoxIcon.Error);
                return false;
            }

            if (mFormMode != EnumAction.Edit)
            {
                DateTime dtmSelectedDate = (DateTime)(this.dtmPostDate.Value);
                //HACK: dungla 01-20-2006, check hour
                dtmSelectedDate = new DateTime(dtmSelectedDate.Year, dtmSelectedDate.Month, dtmSelectedDate.Day,
                    dtmSelectedDate.Hour, dtmSelectedDate.Minute, 0);
                //ENDHACK: dungla 01-20-2006, check hour
                if (intTotalRows <= 0)
                    return false;
                for (int i = 0; i < intTotalRows; i++)
                {
                    dgrdData.Row = i;
                    decimal decReceiveQuantity = 0;
                    int intLocationID = 0;
                    int intPOLineID = 0;

                    #region Purchase Order Master

                    // purchase order master
                    try
                    {
                        if (int.Parse(dgrdData[i, PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD].ToString()) <= 0)
                            throw new Exception();
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Purchase Order Line

                    // purchase order line
                    try
                    {
                        intPOLineID = int.Parse(dgrdData[i, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString());
                        if (intPOLineID <= 0)
                            throw new Exception();
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Postdate must greater than Approved Date
                    voPODetail = (PO_PurchaseOrderDetailVO)boPOReceipt.GetPODetailVO(intPOLineID);

                    //HACK: modified by Tuan TQ. irnoge hour. fix error no 3372.
                    //HACK: dungla 01-20-2006, check hour
                    voPODetail.ApprovalDate = new DateTime(voPODetail.ApprovalDate.Year, voPODetail.ApprovalDate.Month,
                        voPODetail.ApprovalDate.Day, voPODetail.ApprovalDate.Hour, voPODetail.ApprovalDate.Minute, 0);
                    // END: dungla 01-20-2006
                    //End hack

                    // HACK: dungla 11-29-2005
                    if (dtmSelectedDate < voPODetail.ApprovalDate)
                    {
                        // Cannot receive this line because of Post Date < ApprovalDate
                        PCSMessageBox.Show(ErrorCode.MESSAGE_POST_DATE_LESS_THAN_APPROVAL_DATE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                        dgrdData.Select();
                        dtmPostDate.Focus();
                        return false;
                    }
                    // END: dungla 11-29-2005

                    #endregion

                    #region Product

                    // product
                    try
                    {
                        if (int.Parse(dgrdData[i, ITM_ProductTable.PRODUCTID_FLD].ToString()) <= 0)
                            throw new Exception();
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Stock UM

                    // stock um
                    try
                    {
                        if (int.Parse(dgrdData[i, PO_PurchaseOrderReceiptDetailTable.STOCKUMID_FLD].ToString()) <= 0)
                            throw new Exception();
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_UnitOfMeasureTable.TABLE_NAME + MST_UnitOfMeasureTable.CODE_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region check UM rate

                    try
                    {
                        decimal decUMRate = 0;
                        try
                        {
                            decUMRate = decimal.Parse(dgrdData[i, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD].ToString());
                        }
                        catch { }
                        if ((decUMRate <= 0) && (voPODetail.BuyingUMID != voPODetail.StockUMID))
                        {
                            decUMRate = boPOReceipt.GetUMRate(voPODetail.BuyingUMID, voPODetail.StockUMID);
                            if (decUMRate <= 0)
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SET_UMRATE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Select();
                                return false;
                            }
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Location

                    // location
                    try
                    {
                        intLocationID = int.Parse(dgrdData[i, MST_LocationTable.LOCATIONID_FLD].ToString());
                        if (intLocationID <= 0)
                            throw new Exception();
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Selected Location must be in selected Master Location
                    MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(intLocationID);
                    if (voLocation.MasterLocationID != voMasterLocation.MasterLocationID)
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_LOCATION_NOT_MATCH_WITH_MASLOC, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //MessageBox.Show("Selected Location not in selected Master Location");
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                        dgrdData.Select();
                        return false;
                    }
                    #endregion

                    #region Check Lot if Item is Lot controlled or not

                    // item is Lot controlled
                    string strLot = string.Empty;
                    try
                    {
                        // get current row item information
                        ITM_Product voCurrentItem = new ProductItemInfoBO().GetProductInfo(int.Parse(dgrdData[i, PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString()));
                        strLot = dgrdData[i, PO_PurchaseOrderReceiptDetailTable.LOT_FLD].ToString();
                        bool bLotControl = voCurrentItem.LotControl ?? false;
                        if (bLotControl)
                        {
                            // user must enter Lot
                            if (strLot.Equals(null) || strLot.Equals(string.Empty))
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_ENTER_LOT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD]);
                                dgrdData.Select();
                                return false;
                            }
                            if (strLot != null && strLot != string.Empty)
                            {
                                // get total receive quantity of Lot
                                decimal decTotalQuantityOfLot = boPOReceipt.GetTotalReceiveOfLot(dgrdData[i, PO_PurchaseOrderReceiptDetailTable.LOT_FLD].ToString(), voCurrentItem.ProductID, int.Parse(cboCCN.SelectedValue.ToString()));
                                // if Lot is not existed
                                if (decTotalQuantityOfLot.Equals(decimal.MinusOne))
                                {
                                    if (voCurrentItem.LotSize < decReceiveQuantity)
                                    {
                                        // warn user and round up receive quantity with lot size
                                        PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                        // receive quantity with lot size - total receive quantity
                                        dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentItem.LotSize - decTotalQuantityOfLot;
                                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                                        return false;
                                    }
                                }
                                else // lot is existed in system
                                {
                                    // if this Lot is fully receive, warn user to select another lot
                                    if (voCurrentItem.LotSize <= decTotalQuantityOfLot)
                                    {
                                        // warn user and round up receive quantity with lot size
                                        PCSMessageBox.Show(ErrorCode.MESSAGE_LOT_FULL, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD]);
                                        return false;
                                    }
                                    else if (voCurrentItem.LotSize < (decTotalQuantityOfLot + decReceiveQuantity))
                                    {
                                        // warn user and round up receive quantity with lot size
                                        PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                        // receive quantity with lot size - total receive quantity
                                        dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentItem.LotSize - decTotalQuantityOfLot;
                                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                                        return false;
                                    }
                                }
                            }
                        }
                        else if (strLot != null && strLot != string.Empty)
                        {
                            // user cannot select Lot for this Item
                            PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_SELECT_LOT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD] = string.Empty;
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD]);
                            return false;
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_ENTER_LOT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion

                    #region Check Bin if Location is Bin controlled or not
                    int intBinID = 0;
                    if (intLocationID > 0)
                    {
                        try
                        {
                            intBinID = int.Parse(dgrdData[i, MST_BINTable.BINID_FLD].ToString());
                        }
                        catch
                        {
                        }
                        if (voLocation.Bin)
                        {
                            // if Location is Bin controlled but user not select Bin yet
                            if (intBinID <= 0)
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_BIN_FOR_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD]);
                                dgrdData.Select();
                                return false;
                            }
                        }
                        else
                        {
                            // if Location is not Bin controlled but user already select Bin
                            if (intBinID > 0)
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_CANNOT_SELECT_BIN_FOR_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD]);
                                dgrdData.Select();
                                return false;
                            }
                        }
                    }

                    #endregion

                    #region Receive Quantity

                    // receive quantity
                    try
                    {
                        decReceiveQuantity = decimal.Parse(dgrdData[i, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].ToString());
                        if (decReceiveQuantity <= 0)
                        {
                            PCSMessageBox.Show(ErrorCode.POSITIVE_NUMBER, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                            dgrdData.Select();
                            return false;
                        }
                        // get current receive quantity from database
                        decimal decCurrentReceiveQuantity = 0;
                        decimal decOrderQuantity = 0;
                        try
                        {
                            decCurrentReceiveQuantity = decimal.Parse(dgrdData[dgrdData.Row, PO_DeliveryScheduleTable.RECEIVEDQUANTITY_FLD].ToString());
                        }
                        catch { }
                        try
                        {
                            decOrderQuantity = decimal.Parse(dgrdData[dgrdData.Row, PO_DeliveryScheduleTable.DELIVERYQUANTITY_FLD].ToString());
                        }
                        catch { }
                        // if sum of current receive quantity from database and receive quantity input by user
                        // greater than total delivery from po detail then warn user
                        if (decOrderQuantity < (decCurrentReceiveQuantity + decReceiveQuantity)
                            || decOrderQuantity < decReceiveQuantity)
                        {
                            DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_RECEIVE_GREATER_THAN_TOTAL, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                            if (dlgResult == DialogResult.No)
                            {
                                // return last value
                                //dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = strSelectedValue;
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                                dgrdData.Select();
                                return false;
                            }
                        }
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxButtons.OK, MessageBoxIcon.Error);
                        dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                        dgrdData.Select();
                        return false;
                    }

                    #endregion
                }
            }
            return true;
        }

        /// <summary>
        /// This methods uses to assign default value for grid
        /// </summary>
        private void AssignDefaultValue()
        {
            // if receipt by PO then we assign default value for PO MasterID
            if ((radByPO.Checked || radBySlip.Checked) && voPOMaster != null && (voPOMaster.PurchaseOrderMasterID > 0))
            {
                dstData.Tables[0].Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].DefaultValue = voPOMaster.Code;
                dstData.Tables[0].Columns[PO_PurchaseOrderMasterTable.PURCHASEORDERMASTERID_FLD].DefaultValue = voPOMaster.PurchaseOrderMasterID;
            }
            else if ((radByItem.Checked) && voProduct != null && (voProduct.ProductID > 0))
            {
                // if receipt by Item then we assign default value for Product ID
                dstData.Tables[0].Columns[ITM_ProductTable.TABLE_NAME + ITM_ProductTable.CODE_FLD].DefaultValue = voProduct.Code;
                dstData.Tables[0].Columns[ITM_ProductTable.DESCRIPTION_FLD].DefaultValue = voProduct.Description;
                dstData.Tables[0].Columns[ITM_ProductTable.REVISION_FLD].DefaultValue = voProduct.Revision;
                dstData.Tables[0].Columns[ITM_ProductTable.PRODUCTID_FLD].DefaultValue = voProduct.ProductID;
                dstData.Tables[0].Columns[ITM_ProductTable.BUYINGUMID_FLD].DefaultValue = voProduct.BuyingUMID;
            }

            int intRowCount = dgrdData.RowCount;
            for (int i = 0; i < intRowCount; i++)
            {
                if (dgrdData.AddNewMode == AddNewModeEnum.NoAddNew)
                {
                    // get detail information
                    voPODetail = (PO_PurchaseOrderDetailVO)(boPOReceipt.GetPODetailVO(int.Parse(dgrdData[i, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString())));
                    // UMRate
                    if (voPODetail.StockUMID != voPODetail.BuyingUMID)
                    {
                        // get UM Rate
                        decimal decUMRate = boPOReceipt.GetUMRate(voPODetail.BuyingUMID, voPODetail.StockUMID);
                        if (decUMRate > 0)
                            dgrdData[i, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decUMRate;
                        else
                            dgrdData[i, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.MinusOne;
                    }
                    else
                        dgrdData[i, PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD] = decimal.One;
                }
            }
            dstData.Tables[0].Columns[PO_PurchaseOrderReceiptDetailTable.UMRATE_FLD].DefaultValue = decimal.MinusOne;
        }
        #endregion

        private void dgrdData_RowColChange(object sender, C1.Win.C1TrueDBGrid.RowColChangeEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_RowColChange()";
            try
            {
                if (e.LastRow != dgrdData.Row)
                {
                    int intProductID = 0;
                    // if current Item is not controlled by Lot then Lock Lot cell
                    try
                    {
                        intProductID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString().Trim());
                        if (intProductID > 0)
                        {
                            ITM_Product voCurrentProduct = new ProductItemInfoBO().GetProductInfo(intProductID);
                            bool bLotControl = voCurrentProduct.LotControl ?? false;
                            if (!bLotControl)
                                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = true;
                            else
                                dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Locked = false;
                        }
                    }
                    catch { }

                    // check if Lot cell of current row have no value then lock serial cell
                    string strLot = dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.LOT_FLD].ToString().Trim();
                    if ((strLot != null) && (strLot != string.Empty))
                    {
                        // unlock serial column
                        dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = false;
                    }
                    else
                    {
                        // lock serial column
                        dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = true;
                    }
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_OnAddNew(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_RowColChange()";
            try
            {
                //if (dgrdData[dgrdData.Row, RECEIPTLINE_COL].ToString() == string.Empty)
                //{
                int intMaxLine = 0;
                // get max line number
                if (dgrdData.Row > 0)
                {
                    intMaxLine = int.Parse(dgrdData[dgrdData.Row - 1, RECEIPTLINE_COL].ToString());
                }
                dgrdData[dgrdData.Row, RECEIPTLINE_COL] = ++intMaxLine;
                //}
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }


        }

        private void dgrdData_BeforeColUpdate(object sender, C1.Win.C1TrueDBGrid.BeforeColUpdateEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_BeforeColUpdate()";
            try
            {
                string strColumn = dgrdData.Columns[dgrdData.Col].DataField;
                string strValue = dgrdData.Columns[dgrdData.Col].Text.Trim();
                if (strValue == string.Empty)
                    return;
                //string strValue = dgrdData[dgrdData.Row, dgrdData.Col].ToString().Trim();
                Hashtable htbConditions = new Hashtable();
                int intLocationID = 0;
                decimal decReceiveQuantity = 0;
                ITM_Product voCurrentProduct = null;
                string strLot = string.Empty;
                decimal decTotalQuantityOfLot = 0;
                int intPODetailID = 0;
                DataRowView drvData = null;
                switch (strColumn)
                {
                    #region Receive Quantity

                    case PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD:
                        try
                        {
                            intPODetailID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString());
                            if (intPODetailID <= 0)
                                throw new Exception();
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_PRODUCT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            //dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                            dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Text = string.Empty;
                            dgrdData.Focus();
                            dgrdData.Select();
                            //dgrdData.Row = dgrdData.Row;
                            return;
                        }
                        // get current receive quantity from database
                        //						decimal decCurrentReceiveQuantity = 0;
                        //						decimal decOrderQuantity = 0;
                        //						try
                        //						{
                        //							decCurrentReceiveQuantity = decimal.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.TOTALDELIVERY_FLD].ToString());
                        //						}
                        //						catch{}
                        //						try
                        //						{
                        //							decOrderQuantity = decimal.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.ORDERQUANTITY_FLD].ToString());
                        //						}
                        //						catch{}
                        try
                        {
                            decReceiveQuantity = decimal.Parse(strValue);
                            if (decReceiveQuantity <= 0)
                            {
                                PCSMessageBox.Show(ErrorCode.POSITIVE_NUMBER, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                                e.Cancel = true;
                            }
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                            e.Cancel = true;
                        }
                        // if sum of current receive quantity from database and receive quantity input by user
                        // greater than total delivery from po detail then warn user
                        //						if (decOrderQuantity < (decCurrentReceiveQuantity + decReceiveQuantity)
                        //							|| decOrderQuantity < decReceiveQuantity)
                        //						{
                        //							DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_RECEIVE_GREATER_THAN_TOTAL, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                        //							if (dlgResult == DialogResult.No)
                        //							{
                        //								// return last value
                        //								//dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = strSelectedValue;
                        //								//dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD]);
                        //								//dgrdData.Select();
                        //								e.Cancel = true;
                        //							}
                        //						}
                        // get order quantity from PODetail first
                        //voPODetail = (PO_PurchaseOrderDetailVO) (boPOReceipt.GetPODetailVO(int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString())));
                        // get receive quantity input by user
                        try
                        {
                            #region // HACK: DEL dungla 11-16-2005

                            //							decReceiveQuantity = decimal.Parse(strValue);
                            //							if (decReceiveQuantity < 0)
                            //							{
                            //								PCSMessageBox.Show(ErrorCode.POSITIVE_NUMBER, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            //								e.Cancel = true;
                            //							}
                            //
                            //							if (boPOReceipt.IsReceived(intPODetailID))
                            //							{
                            //								// get current receive quantity from database
                            //								decimal decCurrentReceiveQuantity = boPOReceipt.GetTotalReceiveQuantity(intPODetailID);
                            //								// if sum of current receive quantity from database and receive quantity input by user
                            //								// greater than total delivery from po detail then warn user
                            //								if (voPODetail.OrderQuantity < (decCurrentReceiveQuantity + decReceiveQuantity))
                            //								{
                            //									DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_RECEIVE_GREATER_THAN_TOTAL, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                            //									if (dlgResult == DialogResult.No)
                            //									{
                            //										// return last value
                            //										dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = strSelectedValue;
                            //										e.Cancel = true;
                            //									}
                            //								}
                            //							}
                            //							else
                            //							{
                            //								if (voPODetail.OrderQuantity < (decReceiveQuantity))
                            //								{
                            //									DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_RECEIVE_GREATER_THAN_TOTAL, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1);
                            //									if (dlgResult == DialogResult.No)
                            //									{
                            //										// return last value
                            //										dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = strSelectedValue;
                            //									}
                            //								}
                            //							}

                            #endregion // END: DEL dungla 11-16-2005							// compare receive quantity with Lot size if any
                            strLot = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Text.Trim();
                            if ((strLot != null) && (strLot != string.Empty))
                            {
                                // get product information
                                voCurrentProduct = new ProductItemInfoBO().GetProductInfo(int.Parse(dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD].ToString()));
                                // get total receive quantity of Lot
                                decTotalQuantityOfLot = boPOReceipt.GetTotalReceiveOfLot(strLot, voCurrentProduct.ProductID, int.Parse(cboCCN.SelectedValue.ToString()));
                                if (voCurrentProduct.LotSize > 0)
                                {
                                    // if Lot is not existed
                                    if (decTotalQuantityOfLot.Equals(decimal.MinusOne))
                                    {
                                        if (voCurrentProduct.LotSize < decReceiveQuantity)
                                        {
                                            // warn user and round up receive quantity with lot size
                                            PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                            // receive quantity with lot size - total receive quantity
                                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentProduct.LotSize;
                                            e.Cancel = true;
                                        }
                                    }
                                    else // lot is existed in system
                                    {
                                        // if this Lot is fully receive, warn user to select another lot
                                        if (voCurrentProduct.LotSize <= decTotalQuantityOfLot)
                                        {
                                            // warn user and round up receive quantity with lot size
                                            PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD]);
                                            dgrdData.Focus();
                                            dgrdData.Select();
                                        }
                                        else if (voCurrentProduct.LotSize < (decTotalQuantityOfLot + decReceiveQuantity))
                                        {
                                            // warn user and round up receive quantity with lot size
                                            PCSMessageBox.Show(ErrorCode.MESSAGE_LOT_FULL, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                            // receive quantity with lot size - total receive quantity
                                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentProduct.LotSize;
                                            e.Cancel = true;
                                        }
                                    }
                                }
                            }
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            // return default value
                            //dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = strSelectedValue;
                            e.Cancel = true;
                        }
                        break;

                    #endregion

                    #region Lot and Serial

                    case (PO_PurchaseOrderReceiptDetailTable.LOT_FLD):
                        try
                        {
                            intPODetailID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString());
                            if (intPODetailID <= 0)
                                throw new Exception();
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_PRODUCT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                            dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Text = string.Empty;
                            dgrdData.Focus();
                            dgrdData.Select();
                            //dgrdData.Row = dgrdData.Row;
                            return;
                        }
                        //strLot = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.LOT_FLD].Text.Trim();
                        if ((strValue != null) && (strValue != string.Empty))
                        {
                            // unlock serial column
                            dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = false;
                        }
                        else
                        {
                            // lock serial column
                            dgrdData.Splits[0].DisplayColumns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Locked = true;
                            return;
                        }
                        try
                        {
                            decReceiveQuantity = decimal.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].ToString());
                            if (decReceiveQuantity < 0)
                                throw new Exception();
                        }
                        catch
                        {
                            //							PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            //							// return default value
                            //							e.Cancel = true;
                            return;
                        }
                        // if input Lot is existed in system, 
                        // we need to compare the current quantity in Lot
                        // with the receive quantity to full fill the Lot size
                        // get product information
                        voCurrentProduct = new ProductItemInfoBO().GetProductInfo(int.Parse(dgrdData[dgrdData.Row, ITM_ProductTable.PRODUCTID_FLD].ToString()));
                        // get total receive quantity of Lot
                        decTotalQuantityOfLot = boPOReceipt.GetTotalReceiveOfLot(strValue, voCurrentProduct.ProductID, int.Parse(cboCCN.SelectedValue.ToString()));
                        bool bLotControl = voCurrentProduct.LotControl ?? false;
                        if (bLotControl)
                        {
                            // if Lot is not existed
                            if (decTotalQuantityOfLot.Equals(decimal.MinusOne))
                            {
                                if (voCurrentProduct.LotSize < decReceiveQuantity)
                                {
                                    // warn user and round up receive quantity with lot size
                                    PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    // receive quantity with lot size - total receive quantity
                                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentProduct.LotSize;
                                    e.Cancel = true;
                                }
                            }
                            else // lot is existed in system
                            {
                                // if this Lot is fully receive, warn user to select another lot
                                if (voCurrentProduct.LotSize <= decTotalQuantityOfLot)
                                {
                                    // warn user and round up receive quantity with lot size
                                    PCSMessageBox.Show(ErrorCode.MESSAGE_OVER_LOT_SIZE, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    e.Cancel = true;
                                }
                                else if (voCurrentProduct.LotSize < (decTotalQuantityOfLot + decReceiveQuantity))
                                {
                                    // warn user and round up receive quantity with lot size
                                    PCSMessageBox.Show(ErrorCode.MESSAGE_LOT_FULL, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                    // receive quantity with lot size - total receive quantity
                                    dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voCurrentProduct.LotSize;
                                    e.Cancel = true;
                                }
                            }
                        }
                        break;
                    case (PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD):
                        try
                        {
                            intPODetailID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString());
                            if (intPODetailID <= 0)
                                throw new Exception();
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_PRODUCT, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD]);
                            dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD].Text = string.Empty;
                            dgrdData.Focus();
                            dgrdData.Select();
                            //dgrdData.Row = dgrdData.Row;
                            return;
                        }
                        // if user enter serial for item, we must update receipt quantity to 1
                        //string strSerial = dgrdData.Columns[PO_PurchaseOrderReceiptDetailTable.SERIAL_FLD].Text.Trim();
                        if ((strValue != null) && (strValue != string.Empty))
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = decimal.One;
                        else
                        {
                            // get po detail of current row
                            voPODetail = (PO_PurchaseOrderDetailVO)(boPOReceipt.GetPODetailVO(int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString())));
                            // restore receive quantity value
                            dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.RECEIVEQUANTITY_FLD] = voPODetail.OrderQuantity;
                        }
                        break;

                    #endregion

                    #region Purchase order and line

                    // select Purchase No
                    case (PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD):
                        if (radByPO.Checked)
                        {
                            e.Cancel = true;
                            return;
                        }
                        // user must select master location first
                        if (voMasterLocation.Equals(null) || voMasterLocation.MasterLocationID.Equals(0))
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_MASTERLOCATION, MessageBoxIcon.Error);
                            txtMasLoc.Focus();
                            e.Cancel = true;
                            return;
                        }
                        // select all purchase order that order the selected Item from a view
                        htbConditions.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
                        htbConditions.Add(ITM_ProductTable.REVISION_FLD, voProduct.Revision);
                        htbConditions.Add(MST_MasterLocationTable.MASTERLOCATIONID_FLD, voMasterLocation.MasterLocationID);
                        // if user select vendor no, filter with vendor no
                        if (txtVendorNo.Text != string.Empty)
                            htbConditions.Add(PO_PurchaseOrderMasterTable.PARTYID_FLD, int.Parse(txtVendorNo.Tag.ToString()));
                        if (txtLocation.Text != string.Empty)
                            htbConditions.Add(PO_PurchaseOrderMasterTable.VENDORLOCID_FLD, int.Parse(txtLocation.Tag.ToString()));
                        if (strValue != string.Empty)
                            drvData = FormControlComponents.OpenSearchForm(v_PurchaseOrderOfItem.VIEW_NAME, v_PurchaseOrderOfItem.PO_CODE, strValue, htbConditions, true);
                        if (drvData == null)
                        {
                            if (strValue != string.Empty)
                                e.Cancel = true;
                        }
                        else
                            e.Column.DataColumn.Tag = drvData.Row;
                        //FillPOData(drvData.Row);
                        break;
                    // select purchase order line
                    case (PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD):
                        if (radByItem.Checked)
                        {
                            e.Cancel = true;
                            return;
                        }
                        if (voPOMaster.Equals(null) || voPOMaster.PurchaseOrderMasterID.Equals(0))
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_PO, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            txtPurchaseNo.Focus();
                            e.Cancel = true;
                            return;
                        }
                        if (radByPO.Checked)
                            htbConditions.Add(PO_PurchaseOrderDetailTable.PURCHASEORDERMASTERID_FLD, voPOMaster.PurchaseOrderMasterID);
                        else if (radBySlip.Checked)
                        {
                            if (dtmSlipDate != DateTime.MaxValue)
                            {
                                htbConditions.Add(YEAR_FILTER, dtmSlipDate.Year);
                                htbConditions.Add(MONTH_FILTER, dtmSlipDate.Month);
                                htbConditions.Add(DAY_FILTER, dtmSlipDate.Day);
                                htbConditions.Add(HOUR_FILTER, dtmSlipDate.Hour);
                            }
                        }
                        htbConditions.Add(PO_PurchaseOrderDetailTable.PURCHASEORDERMASTERID_FLD, voPOMaster.PurchaseOrderMasterID);
                        if (strValue != string.Empty)
                        {
                            if (radBySlip.Checked)
                                drvData = FormControlComponents.OpenSearchForm(v_ReceiptBySchedule.VIEW_NAME, PO_PurchaseOrderDetailTable.LINE_FLD, strValue, htbConditions, true);
                            else
                                drvData = FormControlComponents.OpenSearchForm(v_PurchaseOrderOfItem.VIEW_NAME, PO_PurchaseOrderDetailTable.LINE_FLD, strValue, htbConditions, true);
                        }
                        if (drvData == null)
                        {
                            if (strValue != string.Empty)
                                e.Cancel = true;
                        }
                        else
                        {
                            string strExpression = PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD
                                + Constants.EQUAL + drvData[PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString();
                            if (radBySlip.Checked)
                                strExpression += Constants.AND + PO_DeliveryScheduleTable.DELIVERYSCHEDULEID_FLD
                                    + Constants.EQUAL + drvData[PO_DeliveryScheduleTable.DELIVERYSCHEDULEID_FLD].ToString();
                            // get current row purchase order detail and delivery schedule
                            int intRowPODetailID = 0;
                            int intDeliveryScheduleID = 0;
                            try
                            {
                                intRowPODetailID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].ToString());
                            }
                            catch { }
                            try
                            {
                                intDeliveryScheduleID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.DELIVERYSCHEDULEID_FLD].ToString());
                            }
                            catch { }
                            // we need to check for exsiting PO Line and delivery line in the list
                            DataRow[] drowExisted = dstData.Tables[0].Select(strExpression);
                            if (drowExisted.Length.Equals(0))
                            {
                                e.Column.DataColumn.Tag = drvData.Row;
                            }
                            else
                            {
                                if (radBySlip.Checked)
                                {
                                    if (drvData[PO_PurchaseOrderDetailTable.PURCHASEORDERDETAILID_FLD].Equals(intRowPODetailID) &&
                                        drvData[PO_DeliveryScheduleTable.DELIVERYSCHEDULEID_FLD].Equals(intDeliveryScheduleID))
                                        e.Column.DataColumn.Tag = drvData.Row;
                                }
                            }
                        }
                        break;

                    #endregion

                    #region Location

                    // select location
                    case (MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD):
                        // user must select master location first
                        if (voMasterLocation.MasterLocationID < 0)
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_MASTERLOCATION, MessageBoxIcon.Error);
                            txtMasLoc.Focus();
                            e.Cancel = true;
                            return;
                        }
                        htbConditions.Add(MST_LocationTable.MASTERLOCATIONID_FLD, voMasterLocation.MasterLocationID);
                        if (strValue != string.Empty)
                            drvData = FormControlComponents.OpenSearchForm(MST_LocationTable.TABLE_NAME, MST_LocationTable.CODE_FLD, strValue, htbConditions, false);
                        if (drvData == null)
                        {
                            if (strValue != string.Empty)
                                e.Cancel = true;
                        }
                        else
                            e.Column.DataColumn.Tag = drvData.Row;
                        break;

                    #endregion

                    #region Bin

                    // select bin
                    case (MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD):
                        try
                        {
                            intLocationID = int.Parse(dgrdData[dgrdData.Row, MST_LocationTable.LOCATIONID_FLD].ToString());
                            // user must select location first
                            if (intLocationID <= 0)
                            {
                                PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                                e.Cancel = true;
                                return;
                            }
                        }
                        catch
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_MUST_SELECT_LOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                            dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD]);
                            e.Cancel = true;
                            return;
                        }
                        MST_LocationVO voLocation = (MST_LocationVO)boPOReceipt.GetLocationInfo(intLocationID);
                        if (voLocation.Bin)
                            dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = false;
                        else
                        {
                            dgrdData.Splits[0].DisplayColumns[MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].Locked = true;
                            return;
                        }
                        string strCondition = MST_BINTable.TABLE_NAME + "." + MST_BINTable.LOCATIONID_FLD + "=" + intLocationID;
                        if (radByInvoice.Checked)
                        {
                            strCondition += " AND " + MST_BINTable.TABLE_NAME + "." + MST_BINTable.BINTYPEID_FLD + " IN ("
                                + (int)BinTypeEnum.OK + "," + (int)BinTypeEnum.NG + ")";
                        }
                        if (strValue != string.Empty)
                            drvData = FormControlComponents.OpenSearchFormWithWhere(MST_BINTable.TABLE_NAME, MST_BINTable.CODE_FLD, strValue, strCondition, false);
                        if (drvData == null)
                        {
                            if (strValue != string.Empty)
                                e.Cancel = true;
                        }
                        else
                            e.Column.DataColumn.Tag = drvData.Row;
                        break;

                    #endregion
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void dgrdData_AfterColUpdate(object sender, ColEventArgs e)
        {
            const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";
            try
            {
                switch (e.Column.DataColumn.DataField)
                {
                    case PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD:
                        if (e.Column.DataColumn.Tag != null && dgrdData[dgrdData.Row, PO_PurchaseOrderMasterTable.TABLE_NAME + PO_PurchaseOrderMasterTable.CODE_FLD].ToString() != string.Empty)
                            FillPOData((DataRow)e.Column.DataColumn.Tag);
                        else
                            FillPOData(null);
                        break;
                    case PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD:
                        if (e.Column.DataColumn.Tag != null && dgrdData[dgrdData.Row, PO_PurchaseOrderDetailTable.TABLE_NAME + PO_PurchaseOrderDetailTable.LINE_FLD].ToString() != string.Empty)
                            FillPOLineData((DataRow)e.Column.DataColumn.Tag);
                        else
                            FillPOLineData(null);
                        break;
                    case MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD:
                        if (e.Column.DataColumn.Tag != null && dgrdData[dgrdData.Row, MST_LocationTable.TABLE_NAME + MST_LocationTable.CODE_FLD].ToString() != string.Empty)
                            FillLocationData((DataRow)e.Column.DataColumn.Tag);
                        else
                            FillLocationData(null);
                        break;
                    case MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD:
                        if (e.Column.DataColumn.Tag != null && dgrdData[dgrdData.Row, MST_BINTable.TABLE_NAME + MST_BINTable.CODE_FLD].ToString() != string.Empty)
                            FillBinData((DataRow)e.Column.DataColumn.Tag);
                        else
                            FillBinData(null);
                        break;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void radBySlip_CheckedChanged(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radBySlip_CheckedChanged()";
            try
            {
                if (!radBySlip.Enabled)
                    return;
                // Avoid recursive
                if (enmStatus == RadioStatus.NoChange) return;
                enmStatus = RadioStatus.BySlip;
                if (!ConfirmRadio()) return;

                EnableButtons();
                if (radBySlip.Checked)
                {
                    txtInvoice.Text = string.Empty;
                    txtPurchaseNo.Text = string.Empty;
                    txtProductionLine.Text = txtOutside.Text = string.Empty;
                    txtItem.Text = string.Empty;
                    txtVendorName.Text = string.Empty;
                    txtVendorNo.Text = string.Empty;
                    voPOMaster = new PO_PurchaseOrderMasterVO();
                    voInvoiceMaster = new PO_InvoiceMasterVO();
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnDeliverySlip_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDeliverySlip_Click()";
            try
            {
                string strSlipNumber = txtDeliverySlip.Text.Trim();
                //HACK: Rem by Tuan TQ. -- Move to public variable for BOM Shortage report
                //string strPONumber = string.Empty;
                //End hack

                if (strSlipNumber == string.Empty)
                {
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock the grid
                    dgrdData.Splits[0].Locked = true;
                    return;
                }
                // user must select CCN first
                int intCCNID = 0;
                try
                {
                    intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
                    if (intCCNID <= 0)
                        throw new Exception();
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Error);
                    cboCCN.Focus();
                    return;
                }
                if (intMasterLocationID <= 0)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_MASTERLOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtMasLoc.Focus();
                    return;
                }
                try
                {
                    // now get the po number from slip number
                    strPONumber = strSlipNumber.Remove(strSlipNumber.Length - SLIP_END_FORMAT.Length - SEPERATOR.Length, SLIP_END_FORMAT.Length + SEPERATOR.Length);
                    // get PO Master object from the code
                    voPOMaster = (PO_PurchaseOrderMasterVO)boPOReceipt.GetPOMasterVO(strPONumber);
                    if (voPOMaster.PurchaseOrderMasterID <= 0)
                        throw new Exception();
                    if (voPOMaster.PurchaseTypeID != (int)POType.Domestic)
                    {
                        string[] strMsg = new string[2];
                        strMsg[0] = radBySlip.Text;
                        strMsg[1] = POType.Domestic.ToString();
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_POTYPE, MessageBoxIcon.Error, strMsg);
                        return;
                    }
                    // remove Po number from the string
                    strSlipNumber = strSlipNumber.Substring(strPONumber.Length + 1);
                    // slip number = yyyyMMddHH
                    // get year from first 4 char of slip number
                    int intYear = int.Parse(strSlipNumber.Substring(0, 4));
                    int intMonth = int.Parse(strSlipNumber.Substring(4, 2));
                    int intDay = int.Parse(strSlipNumber.Substring(6, 2));
                    int intHours = int.Parse(strSlipNumber.Substring(8));
                    dtmSlipDate = new DateTime(intYear, intMonth, intDay, intHours, 0, 0);
                }
                catch
                {
                    string[] strMsg = new string[2];
                    strMsg[0] = txtDeliverySlip.Text.Trim();
                    strMsg[1] = "xxxxx" + SEPERATOR + SLIP_END_FORMAT;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_FORMAT, MessageBoxIcon.Error, strMsg);
                    txtDeliverySlip.Focus();
                    txtDeliverySlip.SelectAll();
                    return;
                }
                intPartyID = voPOMaster.PartyID;
                FillCustomerInfo(intPartyID);
                // retrieve detail data from delivery schedule by PO number
                dstData = boPOReceipt.ListByPOCode(strPONumber, dtmSlipDate);
                // fill to data grid
                if (dstData.Tables.Count > 0 && dstData.Tables[0].Rows.Count > 0)
                    BindDataToGrid(false);
                else
                {
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    BindDataToGrid(false);
                    // lock the grid
                    dgrdData.Splits[0].Locked = true;
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnInvoice_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnInvoice_Click()";
            const string V_InvoiceMasterNotReceiving = "V_InvoiceMasterNotReceiving";
            try
            {
                int intCCNID = 0;
                try
                {
                    intCCNID = int.Parse(cboCCN.SelectedValue.ToString());
                    if (intCCNID <= 0)
                        throw new Exception();
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_CCN, MessageBoxIcon.Error);
                    cboCCN.Focus();
                    return;
                }
                Hashtable htCondition = new Hashtable();
                htCondition.Add(PO_InvoiceMasterTable.CCNID_FLD, intCCNID);
                //htCondition.Add("QAStatus",3);
                DataRowView drowData = null;
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(V_InvoiceMasterNotReceiving, PO_InvoiceMasterTable.INVOICENO_FLD, txtInvoice.Text.Trim(), htCondition, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(V_InvoiceMasterNotReceiving, PO_InvoiceMasterTable.INVOICENO_FLD, txtInvoice.Text.Trim(), htCondition, true);
                if (drowData != null)
                {
                    FillInvoiceData(drowData.Row);
                    dgrdData.AllowAddNew = true;
                    dgrdData.AllowDelete = true;
                    dgrdData.AllowUpdate = true;
                }
                else
                {
                    txtInvoice.Focus();
                    txtInvoice.SelectAll();
                }
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void radByInvoice_CheckedChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radByInvoice_CheckedChanged()";
            try
            {
                if (radByInvoice.Enabled)
                    return;
                // Avoid recursive
                if (enmStatus == RadioStatus.NoChange) return;
                enmStatus = RadioStatus.ByInvoice;
                if (!ConfirmRadio()) return;
                EnableButtons();
                if (radByInvoice.Checked)
                {
                    txtDeliverySlip.Text = string.Empty;
                    txtPurchaseNo.Text = string.Empty;
                    txtItem.Text = string.Empty;
                    txtOutside.Text = txtProductionLine.Text = string.Empty;
                    //txtVendorName.Text = string.Empty;
                    //txtVendorNo.Text = string.Empty;
                    voPOMaster = new PO_PurchaseOrderMasterVO();
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        /// <summary>
        /// Enable or disable button based on receipt type
        /// </summary>
        private void EnableButtons()
        {
            bool blnByPO = (radByPO.Checked && radByPO.Enabled);
            bool blnByItem = (radByItem.Checked && radByItem.Enabled);
            bool blnBySlip = (radBySlip.Checked && radBySlip.Enabled);
            bool blnByInvoice = (radByInvoice.Checked && radByInvoice.Enabled);
            bool blnOutside = (radOutside.Checked && radOutside.Enabled);
            txtItem.Enabled = blnByItem;
            btnSearchItem.Enabled = blnByItem;
            txtDescription.Enabled = blnByItem;
            txtRevision.Enabled = blnByItem;
            txtVendorName.Enabled = blnByInvoice;
            txtVendorNo.Enabled = blnByInvoice;
            txtLocation.Enabled = blnByItem;
            btnSearchVendorByName.Enabled = blnByItem;
            btnSearchDescription.Enabled = blnByItem;
            btnSearchVendorByNo.Enabled = blnByItem;
            btnSearchLocation.Enabled = blnByItem;
            txtPurchaseNo.Enabled = blnByPO;
            btnSearchPO.Enabled = blnByPO;
            chkRecFull.Enabled = blnByPO;
            txtDeliverySlip.Enabled = btnDeliverySlip.Enabled = blnBySlip;
            txtInvoice.Enabled = btnInvoice.Enabled = blnByInvoice;
            txtOutside.Enabled = btnOutside.Enabled = txtProductionLine.Enabled = btnProductionLine.Enabled = lblProductionLine.Enabled = blnOutside;
        }
        private void radOutside_CheckedChanged(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".radOutside_CheckedChanged()";
            try
            {
                if (!radOutside.Enabled)
                    return;
                // Avoid recursive
                if (enmStatus == RadioStatus.NoChange) return;
                enmStatus = RadioStatus.ByOutside;
                if (!ConfirmRadio()) return;
                EnableButtons();
                if (radOutside.Checked)
                {
                    txtInvoice.Text = string.Empty;
                    txtPurchaseNo.Text = string.Empty;
                    txtInvoice.Text = string.Empty;
                    txtDeliverySlip.Text = string.Empty;

                    txtItem.Text = string.Empty;
                    txtVendorName.Text = string.Empty;
                    txtVendorNo.Text = string.Empty;
                    voPOMaster = new PO_PurchaseOrderMasterVO();
                    voInvoiceMaster = new PO_InvoiceMasterVO();
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock grid
                    foreach (C1DisplayColumn dcolC1 in dgrdData.Splits[0].DisplayColumns)
                        dcolC1.Locked = true;
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnOutside_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnOutside_Click()";
            try
            {
                string strSlipNumber = txtOutside.Text.Trim();

                // Empty slip number
                if (strSlipNumber == string.Empty)
                {
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    // lock the grid
                    dgrdData.Splits[0].Locked = true;
                    return;
                }
                if (intMasterLocationID <= 0)
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_RGA_MASTERLOCATION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                    txtMasLoc.Focus();
                    return;
                }
                try
                {
                    // now get the po number from slip number
                    strPONumber = strSlipNumber.Remove(strSlipNumber.Length - SLIP_END_FORMAT.Length - SEPERATOR.Length, SLIP_END_FORMAT.Length + SEPERATOR.Length);
                    // get PO Master object from the code
                    voPOMaster = (PO_PurchaseOrderMasterVO)boPOReceipt.GetPOMasterVO(strPONumber);
                    if (voPOMaster.PurchaseOrderMasterID <= 0)
                        throw new Exception();
                    if (voPOMaster.PurchaseTypeID != (int)POType.Outside)
                    {
                        string[] strMsg = new string[2];
                        strMsg[0] = radOutside.Text;
                        strMsg[1] = POType.Outside.ToString();
                        PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_POTYPE, MessageBoxIcon.Error, strMsg);
                        return;
                    }
                    // remove Po number from the string
                    strSlipNumber = strSlipNumber.Substring(strPONumber.Length + 1);
                    // slip number = yyyyMMddHH
                    // get year from first 4 char of slip number
                    int intYear = int.Parse(strSlipNumber.Substring(0, 4));
                    int intMonth = int.Parse(strSlipNumber.Substring(4, 2));
                    int intDay = int.Parse(strSlipNumber.Substring(6, 2));
                    int intHours = int.Parse(strSlipNumber.Substring(8));
                    dtmSlipDate = new DateTime(intYear, intMonth, intDay, intHours, 0, 0);
                }
                catch
                {
                    string[] strMsg = new string[2];
                    strMsg[0] = txtOutside.Text.Trim();
                    strMsg[1] = "xxxxx" + SEPERATOR + SLIP_END_FORMAT;
                    PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_FORMAT, MessageBoxIcon.Error, strMsg);
                    txtOutside.Focus();
                    txtOutside.SelectAll();
                    return;
                }
                intPartyID = voPOMaster.PartyID;
                FillCustomerInfo(intPartyID);
                // retrieve detail data from delivery schedule by PO number
                dstData = boPOReceipt.ListByPOCode(strPONumber, dtmSlipDate);
                // fill to data grid
                if (dstData.Tables.Count > 0 && dstData.Tables[0].Rows.Count > 0)
                    BindDataToGrid(false);
                else
                {
                    if (dstData != null && dstData.Tables.Count > 0)
                        dstData.Tables[0].Clear();
                    BindDataToGrid(false);
                    // lock the grid
                    dgrdData.Splits[0].Locked = true;
                }

                //HACK: added by Tuan TQ: Enable BOM shortage button
                if (radOutside.Checked
                    && dstData != null
                    && txtProductionLine.Tag != null
                    && strPONumber != string.Empty
                    && !dtmPostDate.Text.Trim().Equals(string.Empty)
                    && !txtOutside.Text.Trim().Equals(string.Empty)
                    && dgrdData.RowCount > 0)
                {
                    btnBOMShortage.Enabled = true;
                }
                else
                {
                    btnBOMShortage.Enabled = false;
                }
                //End
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }

        private void btnProductionLine_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnProductionLine_Click()";
            try
            {
                DataRowView drowData = null;
                if (sender is TextBox && sender != null)
                    drowData = FormControlComponents.OpenSearchForm(PRO_ProductionLineTable.TABLE_NAME, PRO_ProductionLineTable.CODE_FLD, txtProductionLine.Text.Trim(), null, false);
                else
                    drowData = FormControlComponents.OpenSearchForm(PRO_ProductionLineTable.TABLE_NAME, PRO_ProductionLineTable.CODE_FLD, txtProductionLine.Text.Trim(), null, true);

                if (drowData != null)
                {
                    int intProductionLineID = int.Parse(drowData[PRO_ProductionLineTable.PRODUCTIONLINEID_FLD].ToString());
                    txtProductionLine.Tag = intProductionLineID;
                    txtProductionLine.Text = drowData[PRO_ProductionLineTable.CODE_FLD].ToString();
                }
                else
                {
                    txtProductionLine.Focus();
                    txtProductionLine.SelectAll();
                }

                //HACK: added by Tuan TQ: Enable BOM shortage button
                if (radOutside.Checked
                    && dstData != null
                    && txtProductionLine.Tag != null
                    && strPONumber != string.Empty
                    && !dtmPostDate.Text.Trim().Equals(string.Empty)
                    && !txtOutside.Text.Trim().Equals(string.Empty)
                    && dgrdData.RowCount > 0)
                {
                    btnBOMShortage.Enabled = true;
                }
                else
                {
                    btnBOMShortage.Enabled = false;
                }
                //End
            }
            catch (PCSException ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ex.mCode, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                // displays the error message.
                PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxButtons.OK, MessageBoxIcon.Error);
                // log message.
                try
                {
                    Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
        RadioStatus enmOldRadioStatus = RadioStatus.BySlip;
        RadioStatus enmStatus = RadioStatus.BySlip;

        /// <summary>
        /// 
        /// </summary>
        /// <returns>Return True if Accepted change, else False</returns>
        bool ConfirmRadio()
        {
            if (enmStatus != enmOldRadioStatus)
            {
                //Confirm message: Are you sure you want to change type of receipt
                DialogResult dlgResult = PCSMessageBox.Show(ErrorCode.MESSAGE_CONFIRM_CHANGE_TYPE_OF_RECEIVING, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2);
                switch (dlgResult)
                {
                    case DialogResult.Yes:
                        enmOldRadioStatus = enmStatus;
                        return true;
                    //break;
                    default:
                        enmStatus = RadioStatus.NoChange;
                        if (enmOldRadioStatus == RadioStatus.BySlip)
                        {
                            radBySlip.Checked = true;
                            enmStatus = RadioStatus.BySlip;
                        }
                        else if (enmOldRadioStatus == RadioStatus.ByInvoice)
                        {
                            radByInvoice.Checked = true;
                            enmStatus = RadioStatus.ByInvoice;
                        }
                        else if (enmOldRadioStatus == RadioStatus.ByOutside)
                        {
                            radOutside.Checked = true;
                            enmStatus = RadioStatus.ByOutside;
                        }
                        return false;
                    //break;
                }
            }
            else return false;
        }

        private void dgrdData_KeyDown_1(object sender, System.Windows.Forms.KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.F4:
                    dgrdData_ButtonClick(null, null);
                    break;
            }
        }

        private void btnBOMShortage_Click(object sender, System.EventArgs e)
        {
            //return if condition is not match
            if (!radOutside.Checked
                || dstData == null
                || txtProductionLine.Tag == null
                || strPONumber == string.Empty
                || dtmPostDate.Text.Trim().Equals(string.Empty)
                || txtOutside.Text.Trim().Equals(string.Empty)
                || dgrdData.RowCount <= 0)
            {
                return;
            }

            if (dstData.Tables[0].Rows.Count == 0)
            {
                return;
            }

            ShowBOMShortageReport(sender, e);
        }

        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDelete_Click()";
            if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    string strProductID = string.Empty;
                    // get list of item in grid
                    foreach (DataRow drowData in dstData.Tables[0].Rows)
                        strProductID += drowData[PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString() + ",";
                    strProductID = strProductID.Substring(0, strProductID.Length - 1);
                    string strReturnNO = boPOReceipt.CheckReturn(voPOReceiptMaster, strProductID, radByInvoice.Checked);
                    if (strReturnNO != string.Empty)
                    {
                        string[] strMsg = new string[] { strReturnNO };
                        PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_DELETE_RECEIPT, MessageBoxIcon.Information, strMsg);
                        return;
                    }

                    //1. turn form mode to Delete
                    mFormMode = EnumAction.Delete;
                    boPOReceipt.DeletePOReceipt(voPOReceiptMaster.PurchaseOrderReceiptID);
                    //2. turn form mode to Default
                    mFormMode = EnumAction.Default;
                    //3. clear all data
                    ResetForm();
                    //4. Enable and Disable controls
                    SwitchFormMode();
                }
                catch (PCSException ex)
                {
                    // displays the error message.
                    PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    // displays the error message.
                    PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                }
            }
        }

        private void btnDeleteRow_Click(object sender, System.EventArgs e)
        {
            const string METHOD_NAME = THIS + ".btnDeleteRow_Click()";
            if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    string strProductID = string.Empty;
                    strProductID = dgrdData.RowCount > 1
                                       ? dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString()
                                       : dstData.Tables[0].Rows[0][PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString();
                    string strReturnNO = boPOReceipt.CheckReturn(voPOReceiptMaster, strProductID, radByInvoice.Checked);
                    if (strReturnNO != string.Empty)
                    {
                        string[] strMsg = new string[] { strReturnNO };
                        PCSMessageBox.Show(ErrorCode.MESSAGE_CANNOT_DELETE_RECEIPT, MessageBoxIcon.Information, strMsg);
                        return;
                    }
                    if (dgrdData.RowCount > 1)
                    {
                        #region delete row
                        //1. turn form mode to Delete
                        mFormMode = EnumAction.Delete;
                        // If Rows.count = 1 then delete voucher
                        int intPurchaseOrderReceiptID = GetCurrentRow();
                        boPOReceipt.DeleteRowPOReceipt(voPOReceiptMaster.PurchaseOrderReceiptID, intPurchaseOrderReceiptID);
                        //2. turn form mode to Default
                        mFormMode = EnumAction.Default;
                        //3. Load Receipt no
                        DataRowView drowData = FormControlComponents.OpenSearchForm(PO_PurchaseOrderReceiptMasterTable.TABLE_NAME, PO_PurchaseOrderReceiptMasterTable.RECEIVENO_FLD, txtReceiveNo.Text.Trim(), null, false);
                        if (drowData != null)
                            FillMasterData(drowData.Row);
                        #endregion
                    }
                    else
                    {
                        #region Delete voucher
                        //1. turn form mode to Delete
                        mFormMode = EnumAction.Delete;
                        //POPurchaseOrderReceiptsBO objPOChaseOrderReciptBO = new POPurchaseOrderReceiptsBO();
                        boPOReceipt.DeletePOReceipt(voPOReceiptMaster.PurchaseOrderReceiptID);
                        //2. turn form mode to Default
                        mFormMode = EnumAction.Default;
                        //3. clear all data
                        ResetForm();
                        //4. Enable and Disable controls
                        SwitchFormMode();
                        #endregion
                    }

                }
                catch (PCSException ex)
                {
                    // displays the error message.
                    PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                }
                catch (Exception ex)
                {
                    // displays the error message.
                    PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
                    // log message.
                    try
                    {
                        Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
                    }
                    catch
                    {
                        PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
                    }
                }
            }
        }

        private int GetCurrentRow()
        {
            int intPurchaseOrderReceiptID = 0;
            int intProductID = int.Parse(dgrdData[dgrdData.Row, PO_PurchaseOrderReceiptDetailTable.PRODUCTID_FLD].ToString().Trim());
            string strCondition = PO_PurchaseOrderDetailTable.PRODUCTID_FLD + "=" + intProductID.ToString();
            DataRow[] arrMatchedRows = dstData.Tables[0].Select(strCondition);
            if (arrMatchedRows.Length != 0)
                intPurchaseOrderReceiptID = (int)arrMatchedRows[0][PO_PurchaseOrderReceiptDetailTable.PURCHASEORDERRECEIPTDETAILID_FLD];
            return intPurchaseOrderReceiptID;
        }

    }

    /// <summary>
    /// private enum 
    /// </summary>
    enum RadioStatus
    {
        BySlip = 0,
        ByInvoice = 1,
        ByOutside = 2,
        NoChange = 3
    }
}
